Skip to content

Commit

Permalink
Refactor OpenGaussGlobalClockTransactionExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 20, 2024
1 parent a01162e commit f4618e6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ public final class OpenGaussGlobalClockTransactionExecutor implements GlobalCloc

@Override
public void sendSnapshotTimestamp(final Collection<Connection> connections, final long globalTimestamp) throws SQLException {
String setSnapshotTimestampSQL = String.format("SELECT %d AS SETSNAPSHOTCSN", globalTimestamp);
String sql = String.format("SELECT %d AS SETSNAPSHOTCSN", globalTimestamp);
for (Connection each : connections) {
try (Statement statement = each.createStatement()) {
statement.execute(setSnapshotTimestampSQL);
statement.execute(sql);
}
}
}

@Override
public void sendCommitTimestamp(final Collection<Connection> connections, final long globalTimestamp) throws SQLException {
String setCommitTimestampSQL = String.format("SELECT %d AS SETCOMMITCSN", globalTimestamp);
String sql = String.format("SELECT %d AS SETCOMMITCSN", globalTimestamp);
for (Connection each : connections) {
try (Statement statement = each.createStatement()) {
statement.execute(setCommitTimestampSQL);
statement.execute(sql);
}
}
}
Expand Down

0 comments on commit f4618e6

Please sign in to comment.