RE: what does transaction.abort() refresh?
"Boylan, Ross" <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
OK, things work without retrieving via the root objects when I use thread-specific transaction managers. So I can go back to my original mental model. Here's the corrected code:
def tickle(i, me, you):
start = datetime.now()
aTransactionManager = transaction.TransactionManager()
conn = db.open(aTransactionManager)
if i==1:
aManager = Manager()
conn.root.manager = aManager
aVariant = Variant(1)
aManager.addVariant(aVariant)
aTransactionManager.commit()
print("added variant")
you.release()
me.acquire()
else:
me.acquire()
aManager = conn.root.manager
aVariant = aManager._variants[1]
aTransactionManager.abort()
aRun = OneRun(i, start, datetime.now(), 0)
#conn.root.manager._variants[1].add(aRun)
aVariant.add(aRun)
print(i)
aTransactionManager.commit()
you.release()
me.acquire()
aTransactionManager.abort()
aRun = OneRun(i+2, start, datetime.now(), 0)
print(i+2)
#conn.root.manager._variants[1].add(aRun)
aVariant.add(aRun)
aTransactionManager.commit()
you.release()
me.acquire()
aTransactionManager.abort()
if i==1:
conn.root.manager.dump(sys.stdout)
conn.close()
you.release()
--
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.