[ZODB-Dev] question

Christian Reis kiko at async.com.br
Wed Sep 17 12:12:26 EDT 2003


On Sat, Sep 13, 2003 at 12:21:16PM +0200, Dieter Maurer wrote:
> Christian Reis wrote at 2003-9-10 11:53 -0300:
>  > ...
>  > It's great to be able to use the fresh database instances in dialogs --
>  > the code is amazingly simple, you don't need to do temporary storage
>  > hacks -- and, most importantly of all, transactions make handling
>  > "cancel" trivial.  That's object-oriented programming in it's full
>  > glory!
> 
> Why do you not use a *separate* transaction to manage your "out of band"
> objects?

That would be a solution, but my objects aren't really out of band. I
just want to be able to choose to save them separately. 

In my example, a Sale object holds a reference to a Customer, but if the
sale is cancelled, I still want to be able to save the customer's data.

I can't use a separate transaction to edit the Customer because I would
need to call sync() on *Sale's* transaction in order to load the
Customer's fresh changes. This, in turn, would invalidate the changes I
made to Sale.

> In older ZODB versions, a transaction was tightly bound to a thread.
> However, as I understood it, new ZODB versions (don't know when this
> has been introduced) allow to decouple transactions (and ZODB connections)
> from threads (to provide single threaded applications control over several 
> independent connections/transactions).

It was introduced in the 3.1 line, and was Shane's great work. We use it
all the time in this application, actually!

> You may also want to use MVCC (Multi Version Concurrency Control)
> (e.g. as implemented in my "No more ReadConflictErrors" patch) as
> otherwise, long living transactions may see a higher probability
> of ReadConflictErrors.

I've read about your patch before on the list, but I never tried it
personally because RCEs haven't shown themselves to be a real problem in
this application. I'll be experimenting with it later, but the real
question is why hasn't it been considered for inclusion in 3.2?

Take care,
--
Christian Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331



More information about the ZODB-Dev mailing list