feat(mcp): execute sql batches with opt-in rollbackable transactions

This commit is contained in:
Abeautifulsnow authored and GitHub committed 2026-09-04 13:43:06 +08:00
1 parent 7390ac109c
commit 543bf66905
18 files changed
+2496 -219

No files matched your search

@@ -56,8 +56,9 @@ public final class TransactionExecutor {
return unchecked(() -> {
long start = System.currentTimeMillis();
if (!supportsTransactions(conn)) {
long totalAffected = executeAll(conn, statements, schema, setSchemaSql, resetSchemaSql, runner);
return result(totalAffected, start);
// An explicit transaction request must not degrade to auto-commit:
// callers rely on it to avoid partial writes when a later statement fails.
throw new UnsupportedOperationException("Transactions are not supported by this JDBC driver");
}
boolean savedAutoCommit = conn.getAutoCommit();