[ZODB-Dev] get_transaction

Jim Fulton jim@zope.com
Fri, 30 Nov 2001 10:09:24 -0500


Magnus Heino wrote:
> 
> Hi.
> 
> I have  a question about get_transaction()
> 
> ---
> 
> from ZODB import FileStorage, DB
> 
> storage = FileStorage.FileStorage('/tmp/test-filestorage.fs')
> db = DB( storage )
> conn = db.open()
> 
> root1 = conn.root()
> root2 = conn.root()
> 
> root1[1] = 1
> root2[2] = 2
> 
> get_transaction().commit()
> 
> ---
> 
> What will be committed? Both connections?

Yes.

> Can I control that?

Not currently. In thr future, you'll be able to control
it by explictly associating transactions with connections.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org