summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/objectstore.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-10-18 02:00:14 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-10-18 02:00:14 +0000
commit784f74d88e1ac1b658762b82d81f7dcc2c71b93d (patch)
tree64fb525378464f84b979f38c81e346c61e0d798e /lib/sqlalchemy/objectstore.py
parent2f883b49a9c3a66e575ec39222bb070759c50e2b (diff)
downloadsqlalchemy-784f74d88e1ac1b658762b82d81f7dcc2c71b93d.tar.gz
Diffstat (limited to 'lib/sqlalchemy/objectstore.py')
-rw-r--r--lib/sqlalchemy/objectstore.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sqlalchemy/objectstore.py b/lib/sqlalchemy/objectstore.py
index c1883291b..eb74acc11 100644
--- a/lib/sqlalchemy/objectstore.py
+++ b/lib/sqlalchemy/objectstore.py
@@ -108,15 +108,15 @@ class UnitOfWork(object):
self.is_begun = is_begun
if parent is not None:
self.identity_map = parent.identity_map
+ self.attributes = parent.attributes
else:
self.identity_map = {}
- self.attributes = UOWAttributeManager(self)
+ self.attributes = UOWAttributeManager(self)
+
self.new = util.HashSet(ordered = True)
self.dirty = util.HashSet()
self.modified_lists = util.HashSet()
- # the delete list is ordered mostly so the unit tests can predict the argument list ordering.
- # TODO: need stronger unit test fixtures....
- self.deleted = util.HashSet(ordered = True)
+ self.deleted = util.HashSet()
self.parent = parent
def get(self, class_, *id):
@@ -248,6 +248,8 @@ class UnitOfWork(object):
def rollback(self):
if not self.is_begun:
raise "UOW transaction is not begun"
+ # TODO: locate only objects that are dirty/new/deleted in this UOW,
+ # roll only those back.
self.attributes.rollback()
uow.set(self.parent)
@@ -308,7 +310,8 @@ class UOWTransaction(object):
head = self._sort_dependencies()
#print "Task dump:\n" + head.dump()
- head.execute(self)
+ if head is not None:
+ head.execute(self)
def post_exec(self):
"""after an execute/commit is completed, all of the objects and lists that have