diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-25 01:58:27 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-25 01:58:27 +0000 |
| commit | f922fa7b6032370c8cf86c0710727aeee37baff8 (patch) | |
| tree | 8a0ee2e99fccb66268b60190bd21a0e8df7855ad /lib/sqlalchemy/mapping | |
| parent | fcbd4f153980384089ce8d519607a1db8e7e8838 (diff) | |
| download | sqlalchemy-f922fa7b6032370c8cf86c0710727aeee37baff8.tar.gz | |
added check in SessionTrans.begin() that the underlying unit of work is still the current uow
Diffstat (limited to 'lib/sqlalchemy/mapping')
| -rw-r--r-- | lib/sqlalchemy/mapping/objectstore.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/mapping/objectstore.py b/lib/sqlalchemy/mapping/objectstore.py index 6b3d7f034..d6b476562 100644 --- a/lib/sqlalchemy/mapping/objectstore.py +++ b/lib/sqlalchemy/mapping/objectstore.py @@ -98,6 +98,8 @@ class Session(object): uow = property(lambda s:s.__uow, doc="returns the parent UnitOfWork corresponding to this transaction.") def begin(self): """calls begin() on the underlying Session object, returning a new no-op SessionTrans object.""" + if self.parent.uow is not self.uow: + raise InvalidRequestError("This SessionTrans is no longer valid") return self.parent.begin() def commit(self): """commits the transaction noted by this SessionTrans object.""" |
