コード例 #1
0
        def trans(txn):
            self.assertFalse(threadable.isInIOThread(),
                             "Transactions must not run in main thread")

            yield Transaction(name="TEST1").save()
            yield Transaction(name="TEST2").save()

            barrier.wait()  # wait here to delay commit
            returnValue("return value")
コード例 #2
0
        def trans(txn):
            yield Transaction(name="TEST1").save()
            yield Transaction(name="TEST2").save()

            barrier.wait()  # wait here to delay commit
            raise ZeroDivisionError()
コード例 #3
0
 def trans1(txn):
     yield Transaction(name="TEST3").save()
     with transaction() as txn2:
         yield Transaction(name="TEST4").save()
         txn2.rollback()
コード例 #4
0
 def trans2(txn):
     yield Transaction(name="TEST1").save()
     with nested_transaction():
         yield Transaction(name="TEST2").save()
         yield trans1()
     yield Transaction(name="TEST5").save()
コード例 #5
0
 def trans(txn, i):
     yield Transaction(name=str(i)).save()
     if i % 2 == 1:
         txn.rollback()
     else:
         txn.commit()
コード例 #6
0
 def trans1(txn):
     yield Transaction(name="TEST1").save()
     with nested_transaction() as txn2:
         yield Transaction(name="TEST2").save()
         txn2.rollback()
     yield Transaction(name="TEST3").save()
コード例 #7
0
 def trans2(txn):
     threadIds.append(threadable.getThreadID())
     on_trans1_insert.wait()
     yield Transaction(name="TEST1").save()
     barrier2.wait()  # wait here to delay commit
コード例 #8
0
        def trans2(txn):
            yield Transaction(name="TEST2").save()
            yield trans1()

            barrier.wait()  # wait here to delay commit
コード例 #9
0
 def trans1(txn):
     yield Transaction(name="TEST1").save()
     txn.rollback()  # should propagate to the root transaction
コード例 #10
0
 def trans2(txn):
     threadIds.append(threadable.getThreadID())
     yield trans1()
     yield Transaction(name="TEST2").save()
     barrier.wait()  # wait here to delay commit
コード例 #11
0
 def trans1(txn):
     threadIds.append(threadable.getThreadID())
     yield Transaction(name="TEST1").save()