[ZODB-Dev] Checking transaction status?
Jim Fulton
jim@digicool.com
Tue, 10 Jul 2001 16:59:47 -0400
ender wrote:
>
> On Tuesday 10 July 2001 12:30, Greg Ward wrote:
> >>On 10 July 2001, Christian Robottom Reis said:
> >>> I think (know?) this can be done with threads, but my app is really
> >>> single-threaded right now, and I don't want to have to think about that
> >>> right now.
> >>
> >>My understanding is that you can do that with multiple Connections.
> >>I've never tried it, though, so I don't know how it works and I can't
> >>vouch for it.
>
> My understanding is that won't work. you could get separate object spaces
> with multiple connections but of limited utility since they wouldn't have
> transaction isolation. the transaction semantics assign transactions based on
> thread not connection which get its accessor installed as a builtin. so all
> objects get registered in the same transaction and a single commit would
> commit all of them (albeit to different connections), but still not the
> semantics of what christian wants.
This is exactly right. There are a couple of issues here:
- The transaction implementation needs to be replaceable,
so that you can implement different transaction management
policies. I'd like to see:
o Transactions moved into a separate package (from ZODB)
o Some attention given to making transactions more controllable.
- There has to be a way for objects find the transaction manager
globally. This seems to mean that there can only be one
transaction per thread. Maybe there should be a version of
get_transaction that lets you pass an argument (e.g. a connection)
that that could contain data for deciding what transaction to return.
Hm. This deserves some more thought.
Jim
--
Jim Fulton mailto:jim@digicool.com Python Powered!
Technical Director (888) 344-4332 http://www.python.org
Digital Creations http://www.digicool.com http://www.zope.org