Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
3.4.0, 3.4.1, 3.5.0
-
None
Description
We are often using Java text blocks to write SQL statements.
String insertQuery = """ |
INSERT INTO
|
test.table
|
(id, text)
|
VALUES
|
(?, ?);
|
"""; |
|
PreparedStatement stmt = conn.prepareStatement(insertQuery);
|
|
for (int i = 0; i < 20; i++) { |
stmt.setInteger(1, i); |
stmt.setString(2, "text"); |
stmt.addBatch();
|
}
|
|
stmt.executeBatch();
|
With version 3.3.3, this sample statement was executed with `executeBatchBulk`. Since 3.4.0, it is only executed one-by-one with `executeBatchStd` with a dramatically worse performance.
The reason is the query is considered a multi-query, because the semicolon is not very last character in the string:
// multi contains ";" not finishing statement. |
boolean isMulti = multiQueryIdx != -1 && multiQueryIdx < queryLength - 1; |
Attachments
Issue Links
- is caused by
-
CONJ-1173 Bulk implementation returning individual results
- Closed