-
Notifications
You must be signed in to change notification settings - Fork 934
NH-4013 - SQL-Server batcher failure after CloseCommands. #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NH-4013 - SQL-Server batcher failure after CloseCommands. #628
Conversation
c23137c
to
979be3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL-Server batcher and MySql batcher have much in common, but this is not the case of Oracle batcher. So we may refactor this with an additional abstract class, but I am not much inspired by the idea of introducing this for some cases and not for others. (And how to name that? MySqlServerBatcherBase
?)
@@ -74,7 +74,6 @@ protected override void DoExecuteBatch(DbCommand ps) | |||
if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) | |||
{ | |||
Factory.Settings.SqlStatementLogger.LogBatchCommand(currentBatchCommandsLog.ToString()); | |||
currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to ClearCurrentBatch
.
You still have the same issue as #513 |
#513 looks invalid as an issue to me, since we are not supposed to reuse the session (and hence its batcher) after a failure. So for me there is no point trying to fix such case. Unless we intend someday to enable session recovering from failures. Here I fix a "no exception" case, where calling |
And now that is #513 which is "behind", since it will still leave the batcher unusable in case of preparation failure (network error or whatever). I think that is a bit non-sens to change code for an explicitly unsupported use case like re-using the session after an exception. The batcher will still be unusable if the failure occurs outside of |
e134728
to
747dc7a
Compare
Rebased for forcing rebuild, failure on teamcity side (xml report truncated). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
NH-4013 -
SqlClientBatchingBatcher
CloseCommands contract violatedCloseCommands
causesSqlClientBatchingBatcher
andMySqlClientBatchingBatcher
to be unusable although its xml comment states:Test case and fix.