[#4554] [#4555] Fix this also for executeStatic()

This commit is contained in:
lukaseder 2015-09-16 10:40:00 +02:00
parent 88e1ad26ae
commit 85a296620d

View File

@ -162,6 +162,15 @@ class BatchSingle implements BatchBindStep {
@Override
public final int[] execute() {
// [#4554] If no variables are bound this should be treated like a
// BatchMultiple as the intention was most likely to call the varargs
// version of DSLContext#batch(Query... queries) with a single parameter.
if (allBindValues.isEmpty()) {
log.info("Single batch", "No bind variables have been provided with a single statement batch execution. This may be due to accidental API misuse");
return BatchMultiple.execute(configuration, new Query[] { query });
}
checkBindValues();
// [#1180] Run batch queries with BatchMultiple, if no bind variables
@ -181,12 +190,6 @@ class BatchSingle implements BatchBindStep {
}
private final int[] executePrepared() {
// [#4554] If no variables are bound this should be treated like a
// BatchMultiple as the intention was most likely to call the varargs
// version of DSLContext#batch(Query... queries) with a single parameter.
if (allBindValues.isEmpty()) {
return BatchMultiple.execute(configuration, new Query[] { query });
}
ExecuteContext ctx = new DefaultExecuteContext(configuration, new Query[] { query });
ExecuteListener listener = new ExecuteListeners(ctx);
Connection connection = ctx.connection();