Yep, store gets opened on application start, before session-init is called.<br><br>Also, moving init-dummy to open-store :after pushes the problem further, then I get a BDB-DB-ERROR when calling <br><br>(elephant::get-db-schemas (weblocks-elephant::elephant-controller *my-elephant-store*) 'product-item)<br>
<br>- this was optained running code from REPL trying reproduce the error I get when using (weblocks-elephant:count-persisten-objects *my-elephant-store* 'product-item).<br><br>Yarek<br><br>Bad type argument:<br> BDB-DB-ERROR<br>
[Condition of type SIMPLE-TYPE-ERROR]<br><br>Restarts:<br> 0: [RETRY] Retry SLIME REPL evaluation request.<br> 1: [ABORT] Return to SLIME's top level.<br> 2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "new-repl-thread" RUNNING {1004E6B2E1}>)<br>
<br>Backtrace:<br> 0: (MAKE-CONDITION BDB-DB-ERROR)[:EXTERNAL]<br> Locals:<br> SB-DEBUG::ARG-0 = 3<br> SB-DEBUG::ARG-1 = BDB-DB-ERROR<br> 1: (ERROR BDB-DB-ERROR)[:EXTERNAL]<br> Locals:<br> SB-DEBUG::ARG-0 = 3<br>
SB-DEBUG::ARG-1 = BDB-DB-ERROR<br> 2: ((SB-PCL::FAST-METHOD ELEPHANT::EXECUTE-TRANSACTION (DB-BDB::BDB-STORE-CONTROLLER T)) ..)[:EXTERNAL]<br> Locals:<br> SB-DEBUG::ARG-0 = 10<br> SB-DEBUG::ARG-1 = :<NOT-AVAILABLE><br>
SB-DEBUG::ARG-2 = :<NOT-AVAILABLE><br> SB-DEBUG::ARG-3 = #<BDB-STORE-CONTROLLER /home/yarek/lisp/projects/fashion-origami/data/><br> SB-DEBUG::ARG-4 = #<CLOSURE (LAMBDA ()) {100468F019}><br>
3: (ELEPHANT::MAP-BTREE-VALUES #<unavailable lambda list>)<br> [No Locals]<br> 4: (ELEPHANT::GET-DB-SCHEMAS #<BDB-STORE-CONTROLLER /home/yarek/lisp/projects/fashion-origami/data/> PRODUCT-ITEM)<br> Locals:<br>
SB-DEBUG::ARG-0 = #<BDB-STORE-CONTROLLER /home/yarek/lisp/projects/fashion-origami/data/><br> SB-DEBUG::ARG-1 = PRODUCT-ITEM<br> 5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ELEPHANT::GET-DB-SCHEMAS (WEBLOCKS-ELEPHANT::ELEPHANT-CONTROLLER *FASHION-ORIGAMI-ELEPHANT-STORE*) 'PRODUCT-ITEM) #<NULL-LEXENV>)<br>
Locals:<br> SB-DEBUG::ARG-0 = (ELEPHANT::GET-DB-SCHEMAS ..)<br> SB-DEBUG::ARG-1 = #<NULL-LEXENV><br> 6: (SWANK::EVAL-REGION "(elephant::get-db-schemas (weblocks-elephant::elephant-controller *fashion-origami-elephant-store*) 'product-item)\n")<br>
Locals:<br> SB-DEBUG::ARG-0 = "(elephant::get-db-schemas (weblocks-elephant::elephant-controller *fashion..<br><br><br>Yarek<br><br><div class="gmail_quote">On Thu, Dec 11, 2008 at 1:50 PM, Yarek Kowalik <span dir="ltr"><<a href="mailto:yarek.kowalik@gmail.com">yarek.kowalik@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">BDB 4.5 for back-end.<br><br>I'm using elephant-unstable, pulled last week.<br><br>I'm elephant this via Weblocks, so I'm assuming the store is open by the time the init-session for Weblocks app is called. Maybe I should check on that - it's possible that the store is not in fully open state?<br>
<font color="#888888">
<br>Yarek</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Thu, Dec 11, 2008 at 1:19 PM, Ian Eslick <span dir="ltr"><<a href="mailto:eslick@media.mit.edu" target="_blank">eslick@media.mit.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Which version of elephant are you using?<br>
Which backend are you using? If BDB, which version?<br>
<br>
I presume *store-controller* open and reachable from the package you<br>
are in?<br>
<br>
Looks like the elephant store isn't in the proper state (e.g. was<br>
closed and *store-controller* was not zeroed out).<br>
<div><div></div><div><br>
On Dec 11, 2008, at 1:56 PM, Yarek Kowalik wrote:<br>
<br>
> I've converted my weblocks app to use elephant. One of the first<br>
> things I do is to initialize some variables. One of the variables<br>
> is a "demo" item, that I use as a placeholder until the user choses<br>
> something more specific. I'm having trouble initializing the<br>
> dummy. Here is my code:<br>
><br>
> (defun init-dummy-item ()<br>
> (let* ((ref-type 0)<br>
> (ref-id "dummy-item"))<br>
> (setf *dummy-item*<br>
> (unless-use (awhen (elephant:get-instances-by-value<br>
> 'product-item 'reference-id ref-id)<br>
> (find-if (lambda (item)<br>
> (eql (product-item-reference-type<br>
> item) ref-type))<br>
> it))<br>
> (make-instance<br>
> 'product-item<br>
> :reference-type ref-type<br>
> :reference-id ref-id<br>
> :title "No Item selected"<br>
> :url "/pub/static/dummy.html"<br>
> :image-url "/pub/images/dummy.png")))))<br>
><br>
> (The UNLESS-USE macro simply does unless, and if results are nil<br>
> uses the second sexp.)<br>
><br>
> The problem is that I get an error (see trace below) when calling<br>
> GET-INSTANCES-BY-VALUE. What am I doing wrong?<br>
><br>
> The nearest that I can gather is that GET-VALUE is called with the<br>
> secondd argument as NIL, but it's supposed to be something<br>
> reasonable, i.e a controller-index-table held by the controler. For<br>
> whatever raeson that's NIL. What's the deal here? Am I not alowed<br>
> to call the get-instances-by-* methods until I create at least one<br>
> item for each class I'm querying about?<br>
><br>
> Yarek<br>
><br>
> THE ERROR:<br>
><br>
> There is no applicable method for the generic function<br>
> #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET-VALUE (3)><br>
> when called with arguments<br>
> ((FASHION-ORIGAMI::PRODUCT-ITEM<br>
> . FASHION-ORIGAMI::REFERENCE-ID)<br>
> NIL).<br>
> [Condition of type SIMPLE-ERROR]<br>
><br>
> Restarts:<br>
> 0: [TERMINATE-THREAD] Terminate this thread (#<THREAD "hunchentoot-<br>
> worker-4" RUNNING {10029A0321}>)<br>
><br>
> Backtrace:<br>
> 0: ((LAMBDA (SWANK-BACKEND::DEBUGGER-LOOP-FN)) #<FUNCTION (LAMBDA<br>
> #) {1003F6A4C9}>)<br>
> 1: (SWANK::DEBUG-IN-EMACS #<SIMPLE-ERROR {1002E3A1A1}>)<br>
> 2: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION<br>
> SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A9D9}>)<br>
> 3: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION<br>
> {10037B86D1}> #<CLOSURE (LAMBDA #) {1002E3A9F9}>)<br>
> 4: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {10037B86D1}><br>
> #<CLOSURE (LAMBDA #) {1002E3A9D9}>)<br>
> 5: (SWANK:INVOKE-SLIME-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)<br>
> 6: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION<br>
> SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A999}>)<br>
> 7: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)<br>
> 8: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]<br>
> 9: ((SB-PCL::FAST-METHOD HUNCHENTOOT:MAYBE-INVOKE-DEBUGGER (T))<br>
> #<unavailable argument> #<unavailable argument> #<SIMPLE-ERROR<br>
> {1002E3A1A1}>)<br>
> 10: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]<br>
> 11: (ERROR #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]<br>
> 12: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)<br>
> 13: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]<br>
> 14: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]<br>
> 15: (ERROR "~@<There is no applicable method for the generic<br>
> function ~2I~_~S~\n ~I~_when called with arguments<br>
> ~2I~_~S.~:>")[:EXTERNAL]<br>
> Locals:<br>
> SB-DEBUG::ARG-0 = 3<br>
> SB-DEBUG::ARG-1 = "~@<There is no applicable method for the<br>
> generic function ~2I~_~S~\n ..<br>
> 16: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable<br>
> argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION<br>
> ELEPHANT:GET-VALUE (3)>)[:EXTERNAL]<br>
> Locals:<br>
> SB-DEBUG::ARG-0 = 5<br>
> SB-DEBUG::ARG-1 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-2 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-3 = #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET-<br>
> VALUE (3)><br>
> 17: (ELEPHANT::ENSURE-SLOT-DEF-INDEX #<unavailable argument><br>
> #<unavailable argument>)<br>
> Locals:<br>
> SB-DEBUG::ARG-0 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-1 = :<NOT-AVAILABLE><br>
> 18: ((SB-PCL::FAST-METHOD ELEPHANT:FIND-INVERTED-INDEX<br>
> (ELEPHANT:PERSISTENT-METACLASS T)) #<unavailable argument><br>
> #<unavailable argument> #<unavailable argument> #<unavailable<br>
> argument>)[:EXTERNAL]<br>
> Locals:<br>
> SB-DEBUG::ARG-0 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-1 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-2 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-3 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-4 = :<NOT-AVAILABLE><br>
> 19: (ELEPHANT:MAP-INVERTED-INDEX #<unavailable argument><br>
> #<unavailable argument> #<unavailable argument>)[:EXTERNAL]<br>
> Locals:<br>
> SB-DEBUG::ARG-0 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-1 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-2 = :<NOT-AVAILABLE><br>
> SB-DEBUG::ARG-3 = :<NOT-AVAILABLE><br>
> 20: (FASHION-ORIGAMI::INIT-DUMMY-ITEM)<br>
> Locals:<br>
> #:G137 = :<NOT-AVAILABLE><br>
> ANAPHORA:IT = :<NOT-AVAILABLE><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> elephant-devel site list<br>
> <a href="mailto:elephant-devel@common-lisp.net" target="_blank">elephant-devel@common-lisp.net</a><br>
> <a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
<br>
<br>
_______________________________________________<br>
elephant-devel site list<br>
<a href="mailto:elephant-devel@common-lisp.net" target="_blank">elephant-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>