Npgsql.NpgsqlTransactionCallbacks.CommitTransaction C# (CSharp) Method

CommitTransaction() public method

public CommitTransaction ( ) : void
return void
        public void CommitTransaction()
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "CommitTransaction");
            NpgsqlConnection connection = GetConnection();

            if (_prepared)
            {
                NpgsqlCommand.ExecuteBlind(connection.Connector, string.Format("COMMIT PREPARED '{0}'", _txName));
            }
            else
            {
                NpgsqlCommand.ExecuteBlind(connection.Connector, "COMMIT");
            }
        }

Usage Example

示例#1
0
 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "SinglePhaseCommit");
     if (_npgsqlTx != null)
     {
         _npgsqlTx.Commit();
         _npgsqlTx.Dispose();
         _npgsqlTx = null;
         singlePhaseEnlistment.Committed();
     }
     else if (_callbacks != null)
     {
         if (_rm != null)
         {
             _rm.CommitWork(_callbacks.GetName());
             singlePhaseEnlistment.Committed();
         }
         else
         {
             _callbacks.CommitTransaction();
             singlePhaseEnlistment.Committed();
         }
         _callbacks = null;
     }
     _inTransaction = false;
 }
All Usage Examples Of Npgsql.NpgsqlTransactionCallbacks::CommitTransaction