Deprecation problem and ConnectionStateError,
was: Re: [ZODB-Dev] Span transaction over several threads
Diez Roggisch
d.roggisch at ehotel.de
Thu Sep 9 08:52:30 EDT 2004
> in my ZODB-backed corba-server I'd like to span a transaction over several
> corba calls, which are dispatched to one of 7 or so worker threads. When
> calling close after the final commit/rollback, the connection tries to
> unregister a sync object current to the thread - which of course fails, as
> it is has been synched to the thread at work when the connection was
> opened.
Ok, found a solution for that - I can call
setLocalTransaction()
on the connection. But that method is deprecated, instead I shall use the
txn_mgr argument to DB.open().
I'd love to do that, but the docs on that are sparse - what would I have to
pass to DB.open() to have the same thread-spanning transactional behaviour?
Another side-effect of setLocalTransaction() is that when I try to open a
not-yet existing DB, I get
ConnectionStateError: Cannot close a connection joined to a transaction
If I comment things out, everything works as expected. Then I can uncomment
the setLocalTransaction and from there on opening the db works just fine.
The latter problem is more annoying, if there is no solution I guess I can
code around it - but I'd prefer of course to have things working properly.
python is 2.3.4, ZODB is 3.3b2.
Regards,
Diez
More information about the ZODB-Dev
mailing list