File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -119,11 +119,6 @@ public virtual async Task<int> SaveAsync(CancellationToken cancellationToken = d
119119 {
120120 await interceptor . SavedChangesAsync ( interceptorContext , affected , cancellationToken ) ;
121121 }
122-
123- if ( CurrentTransaction is null )
124- {
125- await session . CommitTransactionAsync ( cancellationToken ) ;
126- }
127122 }
128123 catch ( Exception e )
129124 {
@@ -139,9 +134,14 @@ public virtual async Task<int> SaveAsync(CancellationToken cancellationToken = d
139134
140135 throw ;
141136 }
142- finally
137+
138+ if ( CurrentTransaction is null )
143139 {
144- if ( CurrentTransaction is null )
140+ try
141+ {
142+ await session . CommitTransactionAsync ( cancellationToken ) ;
143+ }
144+ finally
145145 {
146146 session . Dispose ( ) ;
147147 }
You can’t perform that action at this time.
0 commit comments