mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 10:39:05 +00:00
Re-enable autocommit
This commit is contained in:
parent
d7858a791a
commit
5a5c139ea6
@ -22,7 +22,6 @@ public abstract class Database {
|
|||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
try {
|
try {
|
||||||
final Connection conn = dataSource.getConnection();
|
final Connection conn = dataSource.getConnection();
|
||||||
conn.setAutoCommit(false);
|
|
||||||
final PreparedStatement statement = conn.prepareStatement(
|
final PreparedStatement statement = conn.prepareStatement(
|
||||||
"INSERT INTO VentureChat " +
|
"INSERT INTO VentureChat " +
|
||||||
"(ChatTime, UUID, Name, Server, Channel, Text, Type) " +
|
"(ChatTime, UUID, Name, Server, Channel, Text, Type) " +
|
||||||
@ -35,7 +34,6 @@ public abstract class Database {
|
|||||||
statement.setString(6, text);
|
statement.setString(6, text);
|
||||||
statement.setString(7, type);
|
statement.setString(7, type);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
conn.commit();
|
|
||||||
} catch(SQLException e) {
|
} catch(SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,6 @@ public class MySQL extends Database {
|
|||||||
dataSource = new HikariDataSource(config);
|
dataSource = new HikariDataSource(config);
|
||||||
try {
|
try {
|
||||||
Connection conn = dataSource.getConnection();
|
Connection conn = dataSource.getConnection();
|
||||||
conn.setAutoCommit(false);
|
|
||||||
Statement statement = conn.createStatement();
|
Statement statement = conn.createStatement();
|
||||||
statement.executeUpdate("CREATE TABLE IF NOT EXISTS VentureChat " +
|
statement.executeUpdate("CREATE TABLE IF NOT EXISTS VentureChat " +
|
||||||
"(ID SERIAL PRIMARY KEY, ChatTime TEXT, UUID TEXT, Name TEXT, " +
|
"(ID SERIAL PRIMARY KEY, ChatTime TEXT, UUID TEXT, Name TEXT, " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user