MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / do_commit_twophase

Method do_commit_twophase

lib/sqlalchemy/dialects/postgresql/base.py:3754–3768  ·  view source on GitHub ↗
(
        self, connection, xid, is_prepared=True, recover=False
    )

Source from the content-addressed store, hash-verified

3752 self.do_rollback(connection.connection)
3753
3754 def do_commit_twophase(
3755 self, connection, xid, is_prepared=True, recover=False
3756 ):
3757 if is_prepared:
3758 if recover:
3759 connection.exec_driver_sql("ROLLBACK")
3760 connection.execute(
3761 sql.text("COMMIT PREPARED :xid").bindparams(
3762 sql.bindparam("xid", xid, literal_execute=True)
3763 )
3764 )
3765 connection.exec_driver_sql("BEGIN")
3766 self.do_rollback(connection.connection)
3767 else:
3768 self.do_commit(connection.connection)
3769
3770 def do_recover_twophase(self, connection):
3771 return connection.scalars(

Callers

nothing calls this directly

Calls 5

exec_driver_sqlMethod · 0.45
executeMethod · 0.45
bindparamsMethod · 0.45
do_rollbackMethod · 0.45
do_commitMethod · 0.45

Tested by

no test coverage detected