File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
NHibernate.Test/NHSpecificTest/DtcFailures Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ public void WillNotCrashOnDtcPrepareFailure()
141
141
}
142
142
143
143
[ Test ]
144
- public void Can_roll_back_transaction ( )
144
+ public void CanRollbackTransaction ( )
145
145
{
146
146
var tx = new TransactionScope ( ) ;
147
147
var disposeCalled = false ;
@@ -218,7 +218,6 @@ public void TransactionInsertWithRollBackTask()
218
218
s . Save ( person ) ;
219
219
ForceEscalationToDistributedTx . Escalate ( true ) ; //will rollback tx
220
220
person . CreatedAt = DateTime . Now ;
221
- s . Update ( person ) ;
222
221
}
223
222
txscope . Complete ( ) ;
224
223
}
@@ -259,7 +258,6 @@ public void TransactionInsertLoadWithRollBackTask()
259
258
{
260
259
var person = s . Get < Person > ( savedId ) ;
261
260
person . CreatedAt = createdAt . AddMonths ( - 1 ) ;
262
- s . Update ( person ) ;
263
261
}
264
262
ForceEscalationToDistributedTx . Escalate ( true ) ;
265
263
@@ -308,7 +306,6 @@ public void TransactionInsertLoadFlushWithRollBackTask()
308
306
{
309
307
var person = s . Get < Person > ( savedId ) ;
310
308
person . CreatedAt = createdAt . AddMonths ( - 1 ) ;
311
- s . Update ( person ) ;
312
309
s . Flush ( ) ;
313
310
}
314
311
ForceEscalationToDistributedTx . Escalate ( true ) ;
@@ -343,7 +340,7 @@ public void MultiThreadedTransaction()
343
340
{
344
341
delegate
345
342
{
346
- Can_roll_back_transaction ( ) ;
343
+ CanRollbackTransaction ( ) ;
347
344
_totalCall ++ ;
348
345
} ,
349
346
delegate
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ private void CloseConnection()
155
155
{
156
156
Factory . ConnectionProvider . CloseConnection ( _connection ) ;
157
157
_connection = null ;
158
+ _connectionAmbientTransaction = null ;
158
159
}
159
160
160
161
public DbConnection GetConnection ( )
@@ -378,6 +379,7 @@ public void EnlistIfRequired()
378
379
// Probable case: nested transaction scope. Supporting this could be done by releasing the
379
380
// connection instead of enlisting.
380
381
_session . Connection . EnlistTransaction ( tran ) ;
382
+ _connectionAmbientTransaction = tran ;
381
383
}
382
384
383
385
private bool RequireConnectionSwapInDtc
You can’t perform that action at this time.
0 commit comments