@testing.requires.two_phase_transactions
def test_reset_rollback_two_phase_no_rollback(self):
    users = self.tables.users
    eng = testing_engine()

    @event.listens_for(eng, 'invalidate')
    def conn_invalidated(dbapi_con, con_record, exception):
        dbapi_con.close()
        raise exception
    with eng.connect() as conn:
        rec = conn.connection._connection_record
        raw_dbapi_con = rec.connection
        conn.begin_twophase()
        conn.execute(users.insert(), user_id=1, user_name='user1')
    assert (rec.connection is raw_dbapi_con)
    with eng.connect() as conn:
        result = conn.execute(select(users.c.user_name).order_by(users.c.user_id))
        eq_(result.fetchall(), [])
@testing.requires.two_phase_transactions
def test_reset_rollback_two_phase_no_rollback(self):
    users = self.tables.users
    eng = testing_engine()

    @event.listens_for(eng, 'invalidate')
    def conn_invalidated(dbapi_con, con_record, exception):
        dbapi_con.close()
        raise exception
    with eng.connect() as conn:
        rec = conn.connection._connection_record
        raw_dbapi_con = rec.connection
        conn.begin_twophase()
        conn.execute(users.insert(), user_id=1, user_name='user1')
    assert (rec.connection is raw_dbapi_con)
    with eng.connect() as conn:
        result = conn.execute(select(users.c.user_name).order_by(users.c.user_id))
        eq_(result.fetchall(), [])