Skip to content

Commit 43b5e2a

Browse files
authored
Merge pull request #119 from DataObjects-NET/commandprocessor-command-disposal-fix-1
CommandProcessors: Use safe dispose for commands
2 parents 967bf62 + 03ed7e0 commit 43b5e2a

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
@@ -174,7 +174,7 @@ private Command ExecuteBatch(int numberOfTasks, QueryRequest lastRequest, Comman
174174
}
175175
finally {
176176
if (!shouldReturnReader) {
177-
context.ActiveCommand.Dispose();
177+
context.ActiveCommand.DisposeSafely();
178178
}
179179
ReleaseCommand(context);
180180
}
@@ -238,7 +238,7 @@ private async Task<Command> ExecuteBatchAsync(int numberOfTasks, QueryRequest la
238238
}
239239
finally {
240240
if (!shouldReturnReader) {
241-
context.ActiveCommand.Dispose();
241+
context.ActiveCommand.DisposeSafely();
242242
}
243243
ReleaseCommand(context);
244244
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public override async Task ExecuteTasksAsync(CommandProcessorContext context, Ca
101101
}
102102
}
103103
finally {
104-
context.ActiveCommand.Dispose();
104+
context.ActiveCommand.DisposeSafely();
105105
ReleaseCommand(context);
106106
}
107107
}

0 commit comments

Comments
 (0)