mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +01:00
Temp fix for MySQL Patch test
This commit is contained in:
parent
d4e6cbbe31
commit
82ac699ea2
@ -17,6 +17,7 @@
|
||||
package com.djrapitops.plan.db.access.transactions;
|
||||
|
||||
import com.djrapitops.plan.api.exceptions.database.DBOpException;
|
||||
import com.djrapitops.plan.db.DBType;
|
||||
import com.djrapitops.plan.db.SQLDB;
|
||||
import com.djrapitops.plan.db.access.ExecStatement;
|
||||
import com.djrapitops.plan.db.access.Query;
|
||||
@ -64,6 +65,8 @@ public abstract class Transaction {
|
||||
try {
|
||||
this.db = db;
|
||||
this.connection = db.getConnection();
|
||||
// Temporary fix for MySQL Patch task test failing, TODO remove after Auto commit is off for MySQL
|
||||
if (connection.getAutoCommit()) connection.setAutoCommit(false);
|
||||
this.savepoint = connection.setSavepoint();
|
||||
} catch (SQLException e) {
|
||||
throw new DBOpException(getClass().getSimpleName() + " initialization failed: " + e.getMessage(), e);
|
||||
@ -73,6 +76,8 @@ public abstract class Transaction {
|
||||
private void finalizeTransaction() {
|
||||
try {
|
||||
handleSavepoint();
|
||||
// Temporary fix for MySQL Patch task test failing, TODO remove after Auto commit is off for MySQL
|
||||
if (db.getType() == DBType.MYSQL) connection.setAutoCommit(true);
|
||||
} catch (SQLException e) {
|
||||
throw new DBOpException(getClass().getSimpleName() + " finalization failed: " + e.getMessage(), e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user