Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Disable auto commit when writing extra data
Browse files Browse the repository at this point in the history
  • Loading branch information
LXGaming committed Sep 3, 2019
1 parent 863585d commit 169f36e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ protected StorageWriteResult writeExtraData(Map<Integer, String> extraDataMap) t

String sql = "INSERT INTO " + tablePrefix + "extra(record_id, json) values(?, ?)";
try (Connection conn = MySQLStorageAdapter.getConnection(); PreparedStatement statement = conn.prepareStatement(sql)) {
conn.setAutoCommit(false);

for (Entry<Integer, String> data : extraDataMap.entrySet()) {
statement.setInt(1, data.getKey());
statement.setString(2, data.getValue());
Expand Down

0 comments on commit 169f36e

Please sign in to comment.