From helmut at cybernetic-systems.de Wed Jan 7 16:21:50 2009 From: helmut at cybernetic-systems.de (Helmut G. Enders) Date: Wed, 07 Jan 2009 17:21:50 +0100 Subject: [rucksack-devel] Error unbound Slot Transaction-id Message-ID: <4964D69E.90203@cybernetic-systems.de> Here is a complete test case with sbcl. ; SLIME 2008-10-30 CL-USER> (require :rucksack) ("SERIALIZE") CL-USER> (rucksack:with-rucksack (rs "/tmp/db") (rucksack:with-transaction () (defclass user () ((no :initarg :no :accessor :no :index :number-index :unique t)) (:index t) (:metaclass rucksack:persistent-class)))) # T CL-USER> (rucksack:with-rucksack (rs "/tmp/db") (rucksack:with-transaction () (make-instance 'user :no 1))) -->> ERROR: Unable to display error condition [Condition of type UNBOUND-SLOT] CL-USER> ;; Now the same call, but with a NIL after the make-instance: ;; No Error. (rucksack:with-rucksack (rs "/tmp/db") (rucksack:with-transaction () (make-instance 'user :no 2) nil)) NIL T CL-USER> There is no meaningful backtrace. debugger invoked on a UNBOUND-SLOT in thread #: (A UNBOUND-SLOT was caught when trying to print *DEBUG-CONDITION* when entering the debugger. Printing was aborted and the UNBOUND-SLOT was stored in SB-DEBUG::*NESTED-DEBUG-CONDITION*.) (CELL-ERROR-NAME SB-DEBUG::*NESTED-DEBUG-CONDITION*) = RUCKSACK:TRANSACTION-ID Helmut From helmut at cybernetic-systems.de Wed Jan 7 18:18:13 2009 From: helmut at cybernetic-systems.de (Helmut G. Enders) Date: Wed, 07 Jan 2009 19:18:13 +0100 Subject: [rucksack-devel] Error unbound Slot Transaction-id In-Reply-To: <2677cc980901070956v7bcd0bacqfef0038916bbfc7b@mail.gmail.com> References: <4964D69E.90203@cybernetic-systems.de> <2677cc980901070956v7bcd0bacqfef0038916bbfc7b@mail.gmail.com> Message-ID: <4964F1E5.6020003@cybernetic-systems.de> Mariano Montone wrote: > Is it possible that > > (rucksack:with-rucksack (rs "/tmp/db") > (rucksack:with-transaction () > (make-instance 'user :no 1))) > > returns a user instance and when the lisp listener tries to print it > fails because it needs to read the slots but there aren't any > transactions anymore? That's why returning nil works fine. You are right: (prog1 'hello (rucksack:with-rucksack (rs "/tmp/db") (rucksack:with-transaction () (make-instance 'user :no 11)))) HELLO without error! OK, only the test case was in the repl, but your idea helps debugging my code. :-) Thanks, Helmut From marianomontone at gmail.com Wed Jan 7 17:56:07 2009 From: marianomontone at gmail.com (Mariano Montone) Date: Wed, 7 Jan 2009 15:56:07 -0200 Subject: [rucksack-devel] Error unbound Slot Transaction-id In-Reply-To: <4964D69E.90203@cybernetic-systems.de> References: <4964D69E.90203@cybernetic-systems.de> Message-ID: <2677cc980901070956v7bcd0bacqfef0038916bbfc7b@mail.gmail.com> Is it possible that (rucksack:with-rucksack (rs "/tmp/db") (rucksack:with-transaction () (make-instance 'user :no 1))) returns a user instance and when the lisp listener tries to print it fails because it needs to read the slots but there aren't any transactions anymore? That's why returning nil works fine. I don't know if that's desirable behavior or not. Beside, I'm just guessing. Cheers Mariano On Wed, Jan 7, 2009 at 2:21 PM, Helmut G. Enders < helmut at cybernetic-systems.de> wrote: > Here is a complete test case with sbcl. > > ; SLIME 2008-10-30 > CL-USER> (require :rucksack) > ("SERIALIZE") > CL-USER> (rucksack:with-rucksack (rs "/tmp/db") > (rucksack:with-transaction () > (defclass user () > ((no :initarg :no :accessor :no :index :number-index :unique > t)) > (:index t) > (:metaclass rucksack:persistent-class)))) > # > T > CL-USER> (rucksack:with-rucksack (rs "/tmp/db") > (rucksack:with-transaction () > (make-instance 'user :no 1))) > > -->> ERROR: Unable to display error condition > [Condition of type UNBOUND-SLOT] > > > CL-USER> ;; Now the same call, but with a NIL after the make-instance: > ;; No Error. > (rucksack:with-rucksack (rs "/tmp/db") > (rucksack:with-transaction () > (make-instance 'user :no 2) nil)) > NIL > T > CL-USER> > > There is no meaningful backtrace. > > > debugger invoked on a UNBOUND-SLOT in thread # RUNNING {A8345B1}>: > (A UNBOUND-SLOT was caught when trying to print *DEBUG-CONDITION* when > entering > the debugger. Printing was aborted and the UNBOUND-SLOT was stored in > SB-DEBUG::*NESTED-DEBUG-CONDITION*.) > (CELL-ERROR-NAME SB-DEBUG::*NESTED-DEBUG-CONDITION*) = > RUCKSACK:TRANSACTION-ID > > Helmut > > > _______________________________________________ > rucksack-devel mailing list > rucksack-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/rucksack-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: