[Sqlalchemy-tickets] Issue #3108: Difference between flushing in outer transaction and committing i
Brought to you by:
zzzeek
|
From: Torsten L. <iss...@bi...> - 2014-07-01 12:27:49
|
New issue 3108: Difference between flushing in outer transaction and committing in nested transaction https://bitbucket.org/zzzeek/sqlalchemy/issue/3108/difference-between-flushing-in-outer Torsten Landschoff: After introducing nested transactions into our software I was greeted with a flurry of ObjectDeletedErrors. It turned out that it makes a huge difference if a change is committed inside a nested transaction or flushed inside the main transaction. >From the database side I expect these to be equivalent: ## Original instructions ## ``` #!sql begin; -- add stuff to the database rollback; ``` ## Updated instructions using nested transactions ## ``` #!sql begin; savepoint inner; -- add stuff to the database release savepoint inner; rollback; ``` # Rationale # When the instructions inside the nested transaction complete successfully, it should make no difference if they are inside a savepoint demarcation or not. # Example code # Please have a look at the attached file nested_rollback.rst. It runs to completion here without error but illustrates the current problem. You can run it using ``` #!sh python -m doctest nested_rollback.rst ``` This seems to be related to issue #2658. |