[Twisted-Python] adapi.Connection._runQuery always does rollback()
Clark C. Evans
cce at clarkevans.com
Sat Apr 26 12:35:38 EDT 2003
On Sat, Apr 26, 2003 at 09:55:46AM -0400, Eric C. Newton wrote:
| I do not understand the logic of always running a rollback even if the
| query is successful. I would, instead, expect this:
One of the ACID properties is to provide for a consistent read,
that is, if N queries are executed in a row, and a change happens
between the two reads, the 2nd query sees things without the change.
If you don't rollback, then the 'read transaction' will still
reflect results at the time the first query was executed.
Therefore, a rollback is needed so that subsequent queries
reflect new changes to the database and is not 'stale'.
More information about the Twisted-Python