diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md
index 09d3b3a..8c1df46 100644
--- a/doc/changes/changelog.md
+++ b/doc/changes/changelog.md
@@ -1,6 +1,6 @@
# Changes
-* [3.5.5](changes_3.5.5.md)
+* [3.6.0](changes_3.6.0.md)
* [3.5.4](changes_3.5.4.md)
* [3.5.3](changes_3.5.3.md)
* [3.5.2](changes_3.5.2.md)
diff --git a/doc/changes/changes_3.5.5.md b/doc/changes/changes_3.6.0.md
similarity index 89%
rename from doc/changes/changes_3.5.5.md
rename to doc/changes/changes_3.6.0.md
index b95bcab..78e2a75 100644
--- a/doc/changes/changes_3.5.5.md
+++ b/doc/changes/changes_3.6.0.md
@@ -1,4 +1,4 @@
-# Test Database Builder for Java 3.5.5, released 2024-??-??
+# Test Database Builder for Java 3.6.0, released 2024-??-??
Code name: Fix CVE-2024-7254 in test dependency `com.google.protobuf:protobuf-java:3.25.1`
@@ -6,10 +6,16 @@ Code name: Fix CVE-2024-7254 in test dependency `com.google.protobuf:protobuf-ja
This release fixes CVE-2024-7254 in test dependency `com.google.protobuf:protobuf-java:3.25.1`.
+The release also speeds up inserting rows into a table by using batch insert.
+
## Security
* #138: Fixed CVE-2024-7254 in test dependency `com.google.protobuf:protobuf-java:3.25.1`
+## Features
+
+* #137: Updated `AbstractImmediateDatabaseObjectWriter#write()` to use batching for inserting rows
+
## Dependency Updates
### Test Dependency Updates
diff --git a/error_code_config.yml b/error_code_config.yml
index f0a5d0f..799dcf0 100644
--- a/error_code_config.yml
+++ b/error_code_config.yml
@@ -2,4 +2,4 @@ error-tags:
TDBJ:
packages:
- com.exasol.dbbuilder
- highest-index: 34
+ highest-index: 35
diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom
index d1c0769..239618b 100644
--- a/pk_generated_parent.pom
+++ b/pk_generated_parent.pom
@@ -3,7 +3,7 @@
4.0.0
com.exasol
test-db-builder-java-generated-parent
- 3.5.5
+ 3.6.0
pom
UTF-8
diff --git a/pom.xml b/pom.xml
index e166d72..2d9d761 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
test-db-builder-java
- 3.5.5
+ 3.6.0
Test Database Builder for Java
pom.xml
https://github.com/exasol/test-db-builder-java/
@@ -176,7 +176,7 @@
test-db-builder-java-generated-parent
com.exasol
- 3.5.5
+ 3.6.0
pk_generated_parent.pom
diff --git a/src/main/java/com/exasol/dbbuilder/dialects/AbstractImmediateDatabaseObjectWriter.java b/src/main/java/com/exasol/dbbuilder/dialects/AbstractImmediateDatabaseObjectWriter.java
index 8e8ba48..2b9c69d 100644
--- a/src/main/java/com/exasol/dbbuilder/dialects/AbstractImmediateDatabaseObjectWriter.java
+++ b/src/main/java/com/exasol/dbbuilder/dialects/AbstractImmediateDatabaseObjectWriter.java
@@ -88,7 +88,8 @@ public void write(final Table table, final Stream> rows) {
try (final PreparedStatement preparedStatement = this.connection.prepareStatement(sql)) {
final boolean autoCommitOriginalState = this.connection.getAutoCommit();
this.connection.setAutoCommit(false);
- rows.forEach(row -> writeRow(table, sql, preparedStatement, row));
+ rows.forEach(row -> addBatch(table, preparedStatement, row));
+ preparedStatement.executeBatch();
if (autoCommitOriginalState) {
this.connection.commit();
this.connection.setAutoCommit(true);
@@ -101,16 +102,15 @@ public void write(final Table table, final Stream> rows) {
}
}
- private void writeRow(final Table table, final String sql, final PreparedStatement preparedStatement,
- final List