[elephant-devel] Re: Postmodern, Act II
Alex Mizrahi
killerstorm at newmail.ru
Sat May 3 07:59:43 UTC 2008
??>> can you catch a backtrace? it seems to be quite relevant here
LPP> 6: (LAMBDA NIL)
LPP> At
LPP> /home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern
LPP> /pm-sql.lisp:1577: (LAMBDA NIL)
LPP> At
LPP> /home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern
LPP> /pm-btree.lisp:2638: (SB-PCL::FAST-METHOD
ELEPHANT::EXECUTE-TRANSACTION
LPP> (DB-POSTMODERN::POSTMODERN-STORE-CONTROLLER
LPP> T))
LPP> At
LPP> /home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern
LPP> /pm-transaction.lisp: 60
LPP> Local variables:
LPP> ARG-0 = 8
LPP> ARG-3 = #<POSTMODERN-STORE-CONTROLLER (POSTGRESQL 127.0.0.1
LPP> mystic-world mystic mystic PORT
LPP> 5433)>
LPP> ARG-4 = #<CLOSURE (LAMBDA NIL) {BA0738D}>
LPP> 9: (SB-PCL::FAST-METHOD (SETF DB-POSTMODERN::INTERNAL-GET-VALUE) (T T
LPP> DB-POSTMODERN::PM-BTREE))
it seems you didn't wrap your code into explicit transaction.
transaction was started implicitly by (setf internal-get-value) before
writing to database, but cache update was done outside transaction, so it
was not initialized properly.
fix is quite simple -- moving all txn functions inside that implicit
transactions.
but if you do not start your transactions explicitly, enclosing as many
operations as posible, global-sync-cache absolutely makes no sense -- it
takes more effort to synchornize changes than to actually load value from
database, if that's just a single value.
so, maybe, if cache is set into global sync mode, it should signal error if
there is no explicit transactions -- because that would be misuse of global
sync cache, leading to significant overhead.
or you think it makes sense to allow such behaviour? it might make sense in
REPL, for example..
More information about the elephant-devel
mailing list