public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
{
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Rollback");
// try to rollback the transaction with either the
// ADO.NET transaction or the callbacks that managed the
// two phase commit transaction.
if (_npgsqlTx != null)
{
_npgsqlTx.Rollback();
_npgsqlTx.Dispose();
_npgsqlTx = null;
singlePhaseEnlistment.Aborted();
}
else if (_callbacks != null)
{
if (_rm != null)
{
_rm.RollbackWork(_callbacks.GetName());
singlePhaseEnlistment.Aborted();
}
else
{
_callbacks.RollbackTransaction();
singlePhaseEnlistment.Aborted();
}
_callbacks = null;
}
_inTransaction = false;
}