[ZODB-Dev] ZODB 3.2.4 ConnectionStateError

Syver Enstad syver at inout.no
Wed Nov 3 09:38:51 EST 2004


I've been using ZODB 3.2 like this:

connection = db.open(waitflag=False)
connection.setLocalTransaction()
connection.sync()

do stuff with connection and sometimes commit the transaction
connection.close()

In the case of not commiting the transaction I now get
ConnectionStateError when I close the connection.

Am I right in assuming that the connection.sync() call I always do is
no longer needed in 3.2.4? In my case it would be just as well if
connection.close() just called self.getTransaction().abort(), but I
guess there are cases that others use where this is not suitable.

Is it safe to access objects in the connection after one has called
abort?

If my assumptions are right I guess I have to do my interactions with
ZODB 3.2.4 like this:

connection = db.open(waitflag=False)
connection.setLocalTransaction()

do stuff with connection and always either commit or abort the transaction
connection.close()





More information about the ZODB-Dev mailing list