1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Lets switch autocommit when commiting in case its in true state

This commit is contained in:
Zrips 2019-10-28 12:49:09 +02:00
parent 9efaa425f2
commit 8e7a959f39

View File

@ -51,7 +51,13 @@ public class JobsConnection {
} }
public synchronized void commit() throws SQLException { public synchronized void commit() throws SQLException {
if (conn.getAutoCommit()) {
conn.setAutoCommit(false);
conn.commit(); conn.commit();
conn.setAutoCommit(true);
} else {
conn.commit();
}
} }
public synchronized DatabaseMetaData getMetaData() throws SQLException { public synchronized DatabaseMetaData getMetaData() throws SQLException {