File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,6 @@ public void CommitTransaction()
215215 }
216216
217217 Transaction . Commit ( ) ;
218- ReleaseTransaction ( ) ;
219218 Committed ? . Invoke ( this , DbSessionEventArgs . None ) ;
220219
221220 #endregion
@@ -227,6 +226,10 @@ public void CommitTransaction()
227226 _diagnosticListener . WriteDbSessionCommitError ( operationId , this , ex ) ;
228227 throw ;
229228 }
229+ finally
230+ {
231+ ReleaseTransaction ( ) ;
232+ }
230233 }
231234
232235 public void RollbackTransaction ( )
@@ -255,7 +258,6 @@ public void RollbackTransaction()
255258 }
256259
257260 Transaction . Rollback ( ) ;
258- ReleaseTransaction ( ) ;
259261 Rollbacked ? . Invoke ( this , DbSessionEventArgs . None ) ;
260262
261263 #endregion
@@ -267,6 +269,10 @@ public void RollbackTransaction()
267269 _diagnosticListener . WriteDbSessionRollbackError ( operationId , this , ex ) ;
268270 throw ;
269271 }
272+ finally
273+ {
274+ ReleaseTransaction ( ) ;
275+ }
270276 }
271277
272278 private void ReleaseTransaction ( )
You can’t perform that action at this time.
0 commit comments