[elephant-devel] Help with an error on app startup/initialization

Yarek Kowalik yarek.kowalik at gmail.com
Thu Dec 11 22:16:10 UTC 2008


Yep, store gets opened on application start, before session-init is called.

Also, moving init-dummy  to open-store :after pushes the problem further,
then I get a BDB-DB-ERROR when calling

(elephant::get-db-schemas (weblocks-elephant::elephant-controller
*my-elephant-store*)  'product-item)

- 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).

Yarek

Bad type argument:
  BDB-DB-ERROR
   [Condition of type SIMPLE-TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [ABORT] Return to SLIME's top level.
 2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "new-repl-thread"
RUNNING {1004E6B2E1}>)

Backtrace:
  0: (MAKE-CONDITION BDB-DB-ERROR)[:EXTERNAL]
      Locals:
        SB-DEBUG::ARG-0 = 3
        SB-DEBUG::ARG-1 = BDB-DB-ERROR
  1: (ERROR BDB-DB-ERROR)[:EXTERNAL]
      Locals:
        SB-DEBUG::ARG-0 = 3
        SB-DEBUG::ARG-1 = BDB-DB-ERROR
  2: ((SB-PCL::FAST-METHOD ELEPHANT::EXECUTE-TRANSACTION
(DB-BDB::BDB-STORE-CONTROLLER T)) ..)[:EXTERNAL]
      Locals:
        SB-DEBUG::ARG-0 = 10
        SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
        SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
        SB-DEBUG::ARG-3 = #<BDB-STORE-CONTROLLER
/home/yarek/lisp/projects/fashion-origami/data/>
        SB-DEBUG::ARG-4 = #<CLOSURE (LAMBDA ()) {100468F019}>
  3: (ELEPHANT::MAP-BTREE-VALUES #<unavailable lambda list>)
      [No Locals]
  4: (ELEPHANT::GET-DB-SCHEMAS #<BDB-STORE-CONTROLLER
/home/yarek/lisp/projects/fashion-origami/data/> PRODUCT-ITEM)
      Locals:
        SB-DEBUG::ARG-0 = #<BDB-STORE-CONTROLLER
/home/yarek/lisp/projects/fashion-origami/data/>
        SB-DEBUG::ARG-1 = PRODUCT-ITEM
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ELEPHANT::GET-DB-SCHEMAS
(WEBLOCKS-ELEPHANT::ELEPHANT-CONTROLLER *FASHION-ORIGAMI-ELEPHANT-STORE*)
'PRODUCT-ITEM) #<NULL-LEXENV>)
      Locals:
        SB-DEBUG::ARG-0 = (ELEPHANT::GET-DB-SCHEMAS ..)
        SB-DEBUG::ARG-1 = #<NULL-LEXENV>
  6: (SWANK::EVAL-REGION "(elephant::get-db-schemas
(weblocks-elephant::elephant-controller *fashion-origami-elephant-store*)
'product-item)\n")
      Locals:
        SB-DEBUG::ARG-0 = "(elephant::get-db-schemas
(weblocks-elephant::elephant-controller *fashion..


Yarek

On Thu, Dec 11, 2008 at 1:50 PM, Yarek Kowalik <yarek.kowalik at gmail.com>wrote:

> BDB 4.5 for back-end.
>
> I'm using elephant-unstable, pulled last week.
>
> 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?
>
> Yarek
>
>
> On Thu, Dec 11, 2008 at 1:19 PM, Ian Eslick <eslick at media.mit.edu> wrote:
>
>> Which version of elephant are you using?
>> Which backend are you using?  If BDB, which version?
>>
>> I presume *store-controller* open and reachable from the package you
>> are in?
>>
>> Looks like the elephant store isn't in the proper state (e.g. was
>> closed and *store-controller* was not zeroed out).
>>
>> On Dec 11, 2008, at 1:56 PM, Yarek Kowalik wrote:
>>
>> > I've converted my weblocks app to use elephant.  One of the first
>> > things I do is to initialize some variables.  One of the variables
>> > is a "demo" item, that I use as a placeholder until the user choses
>> > something more specific.  I'm having trouble initializing the
>> > dummy.  Here is my code:
>> >
>> > (defun init-dummy-item ()
>> >   (let* ((ref-type 0)
>> >          (ref-id "dummy-item"))
>> >     (setf *dummy-item*
>> >           (unless-use (awhen (elephant:get-instances-by-value
>> > 'product-item 'reference-id ref-id)
>> >                         (find-if (lambda (item)
>> >                                    (eql (product-item-reference-type
>> > item) ref-type))
>> >                                  it))
>> >                       (make-instance
>> >                        'product-item
>> >                        :reference-type    ref-type
>> >                        :reference-id    ref-id
>> >                        :title        "No Item selected"
>> >                        :url        "/pub/static/dummy.html"
>> >                        :image-url    "/pub/images/dummy.png")))))
>> >
>> > (The UNLESS-USE macro simply does unless, and if results are nil
>> > uses the second sexp.)
>> >
>> > The problem is that I get an error (see trace below) when calling
>> > GET-INSTANCES-BY-VALUE.  What am I doing wrong?
>> >
>> > The nearest that I can gather is that GET-VALUE is called with the
>> > secondd argument as  NIL, but it's supposed to be something
>> > reasonable, i.e a controller-index-table held by the controler.  For
>> > whatever raeson that's NIL.   What's the deal here?  Am I not alowed
>> > to call the get-instances-by-* methods until I create at least one
>> > item for each class I'm querying about?
>> >
>> > Yarek
>> >
>> > THE ERROR:
>> >
>> > There is no applicable method for the generic function
>> >   #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET-VALUE (3)>
>> > when called with arguments
>> >   ((FASHION-ORIGAMI::PRODUCT-ITEM
>> >     . FASHION-ORIGAMI::REFERENCE-ID)
>> >    NIL).
>> >    [Condition of type SIMPLE-ERROR]
>> >
>> > Restarts:
>> >  0: [TERMINATE-THREAD] Terminate this thread (#<THREAD "hunchentoot-
>> > worker-4" RUNNING {10029A0321}>)
>> >
>> > Backtrace:
>> >   0: ((LAMBDA (SWANK-BACKEND::DEBUGGER-LOOP-FN)) #<FUNCTION (LAMBDA
>> > #) {1003F6A4C9}>)
>> >   1: (SWANK::DEBUG-IN-EMACS #<SIMPLE-ERROR {1002E3A1A1}>)
>> >   2: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION
>> > SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A9D9}>)
>> >   3: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION
>> > {10037B86D1}> #<CLOSURE (LAMBDA #) {1002E3A9F9}>)
>> >   4: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {10037B86D1}>
>> > #<CLOSURE (LAMBDA #) {1002E3A9D9}>)
>> >   5: (SWANK:INVOKE-SLIME-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)
>> >   6: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION
>> > SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A999}>)
>> >   7: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)
>> >   8: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>> >   9: ((SB-PCL::FAST-METHOD HUNCHENTOOT:MAYBE-INVOKE-DEBUGGER (T))
>> > #<unavailable argument> #<unavailable argument> #<SIMPLE-ERROR
>> > {1002E3A1A1}>)
>> >  10: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>> >  11: (ERROR #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>> >  12: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)
>> >  13: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>> >  14: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>> >  15: (ERROR "~@<There is no applicable method for the generic
>> > function ~2I~_~S~\n          ~I~_when called with arguments
>> > ~2I~_~S.~:>")[:EXTERNAL]
>> >       Locals:
>> >         SB-DEBUG::ARG-0 = 3
>> >         SB-DEBUG::ARG-1 = "~@<There is no applicable method for the
>> > generic function ~2I~_~S~\n      ..
>> >  16: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable
>> > argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION
>> > ELEPHANT:GET-VALUE (3)>)[:EXTERNAL]
>> >       Locals:
>> >         SB-DEBUG::ARG-0 = 5
>> >         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-3 = #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET-
>> > VALUE (3)>
>> >  17: (ELEPHANT::ENSURE-SLOT-DEF-INDEX #<unavailable argument>
>> > #<unavailable argument>)
>> >       Locals:
>> >         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>> >  18: ((SB-PCL::FAST-METHOD ELEPHANT:FIND-INVERTED-INDEX
>> > (ELEPHANT:PERSISTENT-METACLASS T)) #<unavailable argument>
>> > #<unavailable argument> #<unavailable argument> #<unavailable
>> > argument>)[:EXTERNAL]
>> >       Locals:
>> >         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-3 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-4 = :<NOT-AVAILABLE>
>> >  19: (ELEPHANT:MAP-INVERTED-INDEX #<unavailable argument>
>> > #<unavailable argument> #<unavailable argument>)[:EXTERNAL]
>> >       Locals:
>> >         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>> >         SB-DEBUG::ARG-3 = :<NOT-AVAILABLE>
>> >  20: (FASHION-ORIGAMI::INIT-DUMMY-ITEM)
>> >       Locals:
>> >         #:G137 = :<NOT-AVAILABLE>
>> >         ANAPHORA:IT = :<NOT-AVAILABLE>
>> >
>> >
>> >
>> > _______________________________________________
>> > elephant-devel site list
>> > elephant-devel at common-lisp.net
>> > http://common-lisp.net/mailman/listinfo/elephant-devel
>>
>>
>> _______________________________________________
>> elephant-devel site list
>> elephant-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20081211/4fd843b9/attachment.html>


More information about the elephant-devel mailing list