File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,14 @@ protected internal void SetClosed()
407
407
closed = true ;
408
408
}
409
409
410
+ protected DbConnection CloseConnectionManager ( )
411
+ {
412
+ if ( ! TransactionCoordinatorShared )
413
+ return ConnectionManager . Close ( ) ;
414
+ ConnectionManager . RemoveDependentSession ( this ) ;
415
+ return null ;
416
+ }
417
+
410
418
private void InitQuery ( IQuery query , NamedQueryDefinition nqd )
411
419
{
412
420
query . SetCacheable ( nqd . IsCacheable ) ;
Original file line number Diff line number Diff line change @@ -278,10 +278,7 @@ public DbConnection Close()
278
278
279
279
try
280
280
{
281
- if ( ! TransactionCoordinatorShared )
282
- return ConnectionManager . Close ( ) ;
283
- ConnectionManager . RemoveDependentSession ( this ) ;
284
- return null ;
281
+ return CloseConnectionManager ( ) ;
285
282
}
286
283
finally
287
284
{
Original file line number Diff line number Diff line change @@ -443,10 +443,7 @@ public void ManagedClose()
443
443
{
444
444
throw new SessionException ( "Session was already closed!" ) ;
445
445
}
446
- if ( TransactionCoordinatorShared )
447
- ConnectionManager . RemoveDependentSession ( this ) ;
448
- else
449
- ConnectionManager . Close ( ) ;
446
+ CloseConnectionManager ( ) ;
450
447
SetClosed ( ) ;
451
448
}
452
449
}
You can’t perform that action at this time.
0 commit comments