On 4/19/06, Robert L. Read <[EMAIL PROTECTED]> wrote:
    I am a little surprised by your use of clsql:start-transaction; the normal idiom for
this is:

       (with-transaction (:store-controller *store-controller*)
         (loop for obj in objs
               for key in keys
               do (setf (get-value key bt) obj))))
  (this is an example for testcollections.lisp)

Are you saying in your email that you could not use this way of doing things?  The
with-transaction macro should be indpendent of the type of the store-controller.

And indeed it is independent, but calls to ele:start-transaction, ele:commit-transaction and ele:abort-transaction are throwing an error for me and their code seems to be BDB specific. I would like to use with-transacton, yet it aborts the transaction on "any non-local exit", while i want to rollback only when some error occurs. TBNL redirect code does (throw 'tbnl:tbnl-handler-done), aborting transaction on each redirect. As in web applications (save-data-to-database) (redirect-to-avoid-double-post) is a very common pattern, i was getting my data reverted every time. So i am doing manual commits/rollbacks, depending on whether the request processing code raised an error or not.

You wrote:
As sqlite requires each thread to have it's own connection by throwing
an error if one thread tries to reuse a connection created by another
thread at least on Ubuntu Dapper. Google says that it depends on a
compile time flag for libsqlite3.

The current Elephant code has no notion of this, and I'm pretty sure it will hand the same connection
to several threads.  Obviously, you could solve this problem by using mutexes to make sure that
only one thread accesses the controller, but that might be quite unpleasant for you code.

At the moment i am doing exactly this - making sure that only one thread is working with elephant at the same time, though it is more of a workaround than a solution.

If these comments can help you provide anymore information about what your possible solutions
are, please reply so I can think about it before I begin debugging it tonight or tomorrow.

You can find more info about the issue with sqlite here:

    http://projects.edgewall.com/trac/ticket/2196

hope that helps.

--
Ignas Mikalajūnas

_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to