void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment) { bool flag = false; try { IAsyncResult result = new PrepareAsyncResult(this, handleEndPrepare, preparingEnlistment); if (result.CompletedSynchronously) { PrepareAsyncResult.End(result); preparingEnlistment.Prepared(); } flag = true; } catch (TransactionException) { } finally { if (!flag) { preparingEnlistment.ForceRollback(); } } }
void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment) { bool success = false; try { IAsyncResult result = new PrepareAsyncResult(this, TransactionContext.handleEndPrepare, preparingEnlistment); if (result.CompletedSynchronously) { PrepareAsyncResult.End(result); preparingEnlistment.Prepared(); } success = true; } //we need to swollow the TransactionException as it could because another party aborting it catch (TransactionException) { } finally { if (!success) { preparingEnlistment.ForceRollback(); } } }
private static void HandleEndPrepare(IAsyncResult result) { PreparingEnlistment asyncState = (PreparingEnlistment)result.AsyncState; bool flag = false; try { if (!result.CompletedSynchronously) { PrepareAsyncResult.End(result); asyncState.Prepared(); } flag = true; } catch (TransactionException) { } finally { if (!flag) { asyncState.ForceRollback(); } } }
static void HandleEndPrepare(IAsyncResult result) { PreparingEnlistment preparingEnlistment = (PreparingEnlistment)result.AsyncState; bool success = false; try { if (!result.CompletedSynchronously) { PrepareAsyncResult.End(result); preparingEnlistment.Prepared(); } success = true; } //we need to swollow the TransactionException as it could because another party aborting it catch (TransactionException) { } finally { if (!success) { preparingEnlistment.ForceRollback(); } } }