File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm/Orm/Upgrade Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[main] Added Query.SingleAsync()/SingleOrDefaultAsync and QueryEndpoint.SingleAsync()/SingleOrDefaultAsync methods
22[main] Addressed issue of not disposing IAsyncEnumerator which caused query being open
3+ [main] Addressed issue of overwriting exception on attempt to rollback the transaction of Domain upgrade if commit operation failed
4+ [postgresql] Update Npgsql to 9.0.4
Original file line number Diff line number Diff line change @@ -172,7 +172,13 @@ private void CompleteUpgradeTransaction()
172172 driver . CommitTransaction ( null , connection ) ;
173173 }
174174 catch {
175- driver . RollbackTransaction ( null , connection ) ;
175+ // If transaction has become broken during commit its rollback leads to new exception
176+ // which will overwrite the original one.
177+ // Check for active transaction should work because on exception within
178+ // driver.Commit it is set to NULL.
179+ if ( connection . ActiveTransaction != null ) {
180+ driver . RollbackTransaction ( null , connection ) ;
181+ }
176182 throw ;
177183 }
178184 }
@@ -190,7 +196,13 @@ private async ValueTask CompleteUpgradeTransactionAsync(CancellationToken token)
190196 await driver . CommitTransactionAsync ( null , connection , token ) ;
191197 }
192198 catch {
193- await driver . RollbackTransactionAsync ( null , connection , token ) ;
199+ // If transaction has become broken during commit its rollback leads to new exception
200+ // which will overwrite the original one.
201+ // Check for active transaction should work because on exception within
202+ // driver.Commit it is set to NULL.
203+ if ( connection . ActiveTransaction != null ) {
204+ await driver . RollbackTransactionAsync ( null , connection , token ) ;
205+ }
194206 throw ;
195207 }
196208 }
You can’t perform that action at this time.
0 commit comments