@testing.requires.two_phase_transactions
def test_multiple_two_phase(self, local_connection):
    conn = local_connection
    users = self.tables.users
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=1, user_name='user1')
    xa.prepare()
    xa.commit()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=2, user_name='user2')
    xa.prepare()
    xa.rollback()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=3, user_name='user3')
    xa.rollback()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=4, user_name='user4')
    xa.prepare()
    xa.commit()
    result = conn.execute(select(users.c.user_name).order_by(users.c.user_id))
    eq_(result.fetchall(), [('user1',), ('user4',)])
@testing.requires.two_phase_transactions
def test_multiple_two_phase(self, local_connection):
    conn = local_connection
    users = self.tables.users
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=1, user_name='user1')
    xa.prepare()
    xa.commit()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=2, user_name='user2')
    xa.prepare()
    xa.rollback()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=3, user_name='user3')
    xa.rollback()
    xa = conn.begin_twophase()
    conn.execute(users.insert(), user_id=4, user_name='user4')
    xa.prepare()
    xa.commit()
    result = conn.execute(select(users.c.user_name).order_by(users.c.user_id))
    eq_(result.fetchall(), [('user1',), ('user4',)])