[elephant-devel] class indexing txn problems

Alex Mizrahi killerstorm at newmail.ru
Tue Mar 11 10:18:39 UTC 2008


suppose following scenario:

1. with store closed (i'm not sure that's essential),
  we create new class definition with persistent slot:

(defclass tsst (persistent-object) ((i :index t)) (:metaclass 
persistent-metaclass))

2. (open-store *spec*)

3. (with-transaction ()
       (find-inverted-index 'tsst 'i)
       (error "bugoga"))

find-inverted-index does two things: creates DB object representing index 
and caches it.
then transaction is aborted -- all DB changes are effectively wiped.

but we still have references to DB object in %index-cache, and accessing 
it's slots produces errors:

4. (find-inverted-index 'tsst 'i)

The slot DB-POSTMODERN::INDICES is unbound in the object 
#<DB-POSTMODERN::PM-INDEXED-BTREE db-table:tree10173 {12746D71}>.
   [Condition of type UNBOUND-SLOT]

i've only tested this on db-postmodern, but it seems other backends might be 
vulnerable too.

i don't see fix to this problem other than disabling index caching 
altogether.

as for workaround, we could catch slot-unbound error when trying to access 
cached index. 






More information about the elephant-devel mailing list