Skip to content

Commit ad8e78e

Browse files
authored
Merge pull request #118 from DataObjects-NET/commandprocessor-command-disposal-fix
CommandProcessors: Use safe dispose for commands
2 parents 2e199f6 + 37d8c26 commit ad8e78e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Orm/Xtensive.Orm/Orm/Providers/CommandProcessing/BatchingCommandProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private Command ExecuteBatch(int numberOfTasks, QueryRequest lastRequest, Comman
176176
}
177177
finally {
178178
if (!shouldReturnReader) {
179-
context.ActiveCommand.Dispose();
179+
context.ActiveCommand.DisposeSafely();
180180
}
181181
ReleaseCommand(context);
182182
}
@@ -245,7 +245,7 @@ private async Task<Command> ExecuteBatchAsync(int numberOfTasks, QueryRequest la
245245
}
246246
finally {
247247
if (!shouldReturnReader) {
248-
await context.ActiveCommand.DisposeAsync().ConfigureAwait(false);
248+
await context.ActiveCommand.DisposeSafelyAsync().ConfigureAwait(false);
249249
}
250250

251251
ReleaseCommand(context);

Orm/Xtensive.Orm/Orm/Providers/CommandProcessing/SimpleCommandProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public override async Task ExecuteTasksAsync(CommandProcessorContext context, Ca
100100
}
101101
}
102102
finally {
103-
await context.ActiveCommand.DisposeAsync().ConfigureAwait(false);
103+
await context.ActiveCommand.DisposeSafelyAsync().ConfigureAwait(false);
104104
ReleaseCommand(context);
105105
}
106106
}

0 commit comments

Comments
 (0)