Skip to content

Commit 339ed81

Browse files
committed
fixed addbatch
1 parent ff55cc0 commit 339ed81

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/me/cobeine/sqlava/connection/database/query/PreparedQuery.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ public void executeUpdateAsync(final Callback<Integer, SQLException> callback) {
143143
}
144144
});
145145
}
146-
private void addBatch() throws SQLException {
147-
if (batched)
148-
return;
149-
if (connection.getAutoCommit()) {
150-
connection.setAutoCommit(false);
146+
public void addBatch() throws SQLException {
147+
if (!batched) {
148+
if (connection.getAutoCommit()) {
149+
connection.setAutoCommit(false);
150+
}
151+
batched = true;
151152
}
152153
statement.addBatch();
153-
batched = true;
154154
}
155155

156156
public void addBatch(String s) throws SQLException {

0 commit comments

Comments
 (0)