[ZODB-Dev] get_transaction

Michel Pelletier michel@zope.com
Thu, 29 Nov 2001 13:51:00 -0800


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? Can I control that?

There's only one connection, you created two references to the same
object.

-Michel