本文整理汇总了C#中System.Transactions.SinglePhaseEnlistment.Committed方法的典型用法代码示例。如果您正苦于以下问题:C# SinglePhaseEnlistment.Committed方法的具体用法?C# SinglePhaseEnlistment.Committed怎么用?C# SinglePhaseEnlistment.Committed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.SinglePhaseEnlistment
的用法示例。
在下文中一共展示了SinglePhaseEnlistment.Committed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SinglePhaseCommit
/// <summary>
/// Notifies an enlisted object that the transaction is being committed.
/// </summary>
/// <param name="singlePhaseEnlistment">A <see cref="T:System.Transactions.SinglePhaseEnlistment"/> interface used to send a response to the transaction manager.</param>
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
onTxComplete();
session.Commit(GetLocalOrDistributedTransactionId(transaction));
singlePhaseEnlistment.Committed();
}
示例2: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment en)
{
if (en == null)
{
throw new ArgumentNullException("en");
}
try
{
this.handle.WaitOne();
}
catch (ObjectDisposedException)
{
}
lock (this.syncRoot)
{
try
{
this.transaction.Commit();
en.Committed();
}
catch (Exception exception)
{
en.Aborted(exception);
}
finally
{
if ((this.connection != null) && (this.connection.State != ConnectionState.Closed))
{
this.connection.Close();
this.connection = null;
}
}
}
}
示例3: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
simpleTransaction.Commit();
singlePhaseEnlistment.Committed();
DriverTransactionManager.RemoveDriverInTransaction(baseTransaction);
if (connection.State == ConnectionState.Closed)
connection.CloseFully();
}
示例4:
void IPromotableSinglePhaseNotification.SinglePhaseCommit( SinglePhaseEnlistment singlePhaseEnlistment ) {
this.simpleTransaction.Commit();
singlePhaseEnlistment.Committed();
DriverTransactionManager.RemoveDriverInTransaction( this.baseTransaction );
this.connection.driver.CurrentTransaction = null;
if( this.connection.State == ConnectionState.Closed ) {
this.connection.CloseFully();
}
}
示例5: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
try
{
Neo4jTransaction.DoCommit(_transactionExecutionEnvironment);
singlePhaseEnlistment.Committed();
}
finally
{
singlePhaseEnlistment.Aborted();
}
}
示例6: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
if (this.disposed)
{
return;
}
try
{
if (this.dataAccessObjectDataContext != null)
{
this.commandsContext = this.GetSqlTransactionalCommandsContext();
this.dataAccessObjectDataContext.Commit(this.commandsContext, false);
this.commandsContext.Commit();
}
singlePhaseEnlistment.Committed();
}
catch (Exception e)
{
ActionUtils.IgnoreExceptions(() => this.commandsContext.Rollback());
singlePhaseEnlistment.Aborted(e);
}
finally
{
this.Dispose();
}
}
示例7: SinglePhaseCommit
public virtual void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
{
enlistment.Committed();
this.Completed();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:TransactionInstanceContextFacet.cs
示例8: SinglePhaseCommit
/// <summary>
/// Notifies an enlisted object that the transaction is being committed.
/// </summary>
/// <param name="singlePhaseEnlistment">A <see cref="SinglePhaseEnlistment"/>
/// interface used to send a response to the transaction manager.
/// </param>
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
m_dbTransaction.Commit();
singlePhaseEnlistment.Committed();
m_dbConnection.Enlistment = null;
if (m_disposeConnection)
{
m_dbConnection.Dispose();
}
}
示例9: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
try
{
DataAccessModelTransactionManager.currentlyCommitingTransaction = this.Transaction;
this.dataAccessObjectDataContext?.Commit(this, false);
foreach (var persistenceTransactionContext in this.persistenceTransactionContextsBySqlDatabaseContexts.Values)
{
persistenceTransactionContext.sqlDatabaseCommandsContext.Commit();
}
singlePhaseEnlistment.Committed();
}
catch (Exception e)
{
foreach (var persistenceTransactionContext in this.persistenceTransactionContextsBySqlDatabaseContexts.Values)
{
try
{
persistenceTransactionContext.sqlDatabaseCommandsContext.Rollback();
}
catch
{
}
}
singlePhaseEnlistment.Aborted(e);
}
finally
{
DataAccessModelTransactionManager.currentlyCommitingTransaction = null;
this.Dispose();
}
}
示例10: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
_log.Debug("Single Phase Commit");
if (_npgsqlTx != null)
{
_npgsqlTx.Commit();
_npgsqlTx.Dispose();
_npgsqlTx = null;
singlePhaseEnlistment.Committed();
_connection.PromotableLocalTransactionEnded();
}
else if (_callbacks != null)
{
if (_rm != null)
{
_rm.CommitWork(_callbacks.GetName());
singlePhaseEnlistment.Committed();
}
else
{
_callbacks.CommitTransaction();
singlePhaseEnlistment.Committed();
}
_callbacks = null;
}
_inTransaction = false;
}
示例11: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
log.Debug("SinglePhaseCommit {0}", TransactionId);
if (_onprepare != null) _onprepare(this);
if (_oncommit != null) _oncommit(this);
singlePhaseEnlistment.Committed();
TransactionOpen = false;
}
示例12: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
this.Release();
this.Dispose();
singlePhaseEnlistment.Committed();
}
示例13: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
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;
}
示例14: SinglePhaseCommit
public virtual void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
if (_SinglePhaseCommitCalled) throw new ApplicationException("single phase commit called before");
_SinglePhaseCommitCalled = true;
singlePhaseEnlistment.Committed();
}
示例15: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
sessionImpl.Commit(txId);
singlePhaseEnlistment.Committed();
}