[elephant-devel] class indexing txn problems

Ian Eslick eslick at media.mit.edu
Tue Mar 11 11:08:09 UTC 2008


Good catch.  I'll see if there is a clean way to avoid these kinds of  
errors in the new version of class indexing I'm wrapping up.

Ian

On Mar 11, 2008, at 6:18 AM, Alex Mizrahi wrote:

> 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.
>
>
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel




More information about the elephant-devel mailing list