[ZODB-Dev] ZODB4 project plan

Shane Hathaway shane@zope.com
Fri, 29 Nov 2002 12:41:37 -0500


On 11/29/2002 09:47 AM, Christian Reis wrote:

> On Fri, Nov 29, 2002 at 01:44:08PM +0100, holger krekel wrote:
>
> >Though the transactions i like to have are somewhat different from
> >transactions which help persisting state.  The latter usually have
> >to deal with XA/Data managers and thus with security/users etc.
> >while the former just need to assist managing states in RAM.
> >But tying a 2PC protocol (storage transactions) to the outermost
> >application transaction often does make sense.
>
>
> Wow, this is exactly what I want. I need to keep different "views" of my
> application objects, one per window (but inside a single thread), and to
> be able to check that set in to the persistence mechanism (or not).
> Right now I do it in a very dumb way (using the new module, and making a
> copy of the object's state -- yes, this breaks if we change a foreign
> object and want to roll that back) but I would die to have an easy way
> to do that. I've even pondered using threads for this, but I would
> rather use the GUI main loop as it should be.

I wonder if in your case you really want a separate database connection 
per window.  Wouldn't that do exactly what you want?  Would it break 
anything?  (Set aside for a moment the issue of possibly consuming 
excessive RAM when many windows are open.)

You would also want to decouple transactions from threads, which isn't 
very hard, especially since there's now a Connection.register() method 
which you can override to choose the correct transaction.  I won't 
ramble on about this unless you tell me I'm on the right track, though. :-)

Shane