[elephant-devel] running out of locks

Ben ben at medianstrip.net
Sat Feb 12 20:45:10 UTC 2005


On Sat, 12 Feb 2005, [utf-8] Gábor Melis wrote:

> A related problem - although not with elephant - is using cursors to iterate
> over more than "Maximum number of locks possible" elements in a transaction.
> Runs out of locks predictably using up 1 lock per object. If there is no
> enclosing transaction it uses 1 lock max. Looking at
> http://www.sleepycat.com/docs/ref/lock/max.html it sounds normal :-(. They
> are going to support cursors releasing locks for passed objects, but until
> then I'll iterate with no enclosing transaction:

where did you find info on releasing locks on passed objects?

> the only question is how to make sure there is no enclosing transaction? I'm
> thinking maybe something like this would do:
>
> (defmacro without-transaction (() &body)
>  `(run-elephant-thread (lambda () , at body)))

the current transaction is held in the *current-transaction* special.
i think if you can do something like

(defmacro without-transaction (&body)
   (let ((*current-transaction* +NULL-VOID+))
     `, at body))

and the stuff in body should be not in a transaction.  (i don't
remember my backquote syntax.....)

caveat: there is some hair with the way with-transaction works, so i
can't 100% guarantee nesting with and withouts will be totally kosher.
it is supposed to work though so if you run into problems with this
let me know.

take care, B


More information about the elephant-devel mailing list