Commit 017cfa99 authored by Jeremy Hylton's avatar Jeremy Hylton

Call transaction manager directly rather than using getTransaction().

parent 4c802a93
...@@ -72,7 +72,8 @@ class StressTask: ...@@ -72,7 +72,8 @@ class StressTask:
self.step = step self.step = step
self.sleep = sleep self.sleep = sleep
self.added_keys = [] self.added_keys = []
self.cn = self.db.open(txn_mgr=transaction.TransactionManager()) self.tm = transaction.TransactionManager()
self.cn = self.db.open(txn_mgr=self.tm)
self.cn.sync() self.cn.sync()
def doStep(self): def doStep(self):
...@@ -83,11 +84,11 @@ class StressTask: ...@@ -83,11 +84,11 @@ class StressTask:
def commit(self): def commit(self):
cn = self.cn cn = self.cn
key = self.startnum key = self.startnum
cn.getTransaction().note("add key %s" % key) self.tm.get().note("add key %s" % key)
try: try:
cn.getTransaction().commit() self.tm.get().commit()
except ConflictError, msg: except ConflictError, msg:
cn.getTransaction().abort() self.tm.get().abort()
cn.sync() cn.sync()
else: else:
if self.sleep: if self.sleep:
...@@ -96,7 +97,7 @@ class StressTask: ...@@ -96,7 +97,7 @@ class StressTask:
self.startnum += self.step self.startnum += self.step
def cleanup(self): def cleanup(self):
self.cn.getTransaction().abort() self.tm.get().abort()
self.cn.close() self.cn.close()
def _runTasks(rounds, *tasks): def _runTasks(rounds, *tasks):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment