Exemplo n.º 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")
Exemplo n.º 2
0
        def trans(txn):
            yield Transaction(name="TEST1").save()
            yield Transaction(name="TEST2").save()

            barrier.wait()  # wait here to delay commit
            raise ZeroDivisionError()
Exemplo n.º 3
0
 def trans1(txn):
     yield Transaction(name="TEST3").save()
     with transaction() as txn2:
         yield Transaction(name="TEST4").save()
         txn2.rollback()
Exemplo n.º 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()
Exemplo n.º 5
0
 def trans(txn, i):
     yield Transaction(name=str(i)).save()
     if i % 2 == 1:
         txn.rollback()
     else:
         txn.commit()
Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 8
0
        def trans2(txn):
            yield Transaction(name="TEST2").save()
            yield trans1()

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