You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
P1: closing a JDBC connection after unconfirmed rollback can commit pending writes #237
Follow-up to review-only draft #236 at edbae2b. JdbcSqlExecutor.executeInTransaction skips setAutoCommit restoration after rollback cannot be confirmed, but its outer finally still calls connection.close(). The Java SE Connection contract says close with an active transaction has implementation-defined results: https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/java/sql/Connection.html . A DataSource/pool wrapper may commit during close or reset, so this cleanup is not generically rollback-safe.\n\nProposed deterministic counterexample: a SQLite-backed Connection proxy fails rollback while keeping the transaction open; its close emulates a valid commit-on-close policy. The executor must report TRANSACTION_OUTCOME_UNKNOWN and must not call that unsafe close path. Consider abort/invalidate as the default fail-closed disposal path, with a clear operational warning if abort itself fails. Preserve the original uncertain outcome and ledger reload guard. This issue is a review finding, not a claim that every JDBC driver commits on close.
Deterministic counterexample confirmed on #236: the test connection retained an active SQLite transaction after injected rollback failure, and the old close path committed its row. Draft follow-up #238 (head 8135bcf) avoids unsafe close, retries rollback once, and treats failed/no-op abort as unsafe to close. Targeted tests and the full Java-to-SQLite reactor pass locally (SQLite 293 passed, 1 skipped). This remains review-only; driver/pool behavior must be reviewed before integrating #236/#238.
Activity
philipgreat commentedon Oct 19, 2026
Deterministic counterexample confirmed on #236: the test connection retained an active SQLite transaction after injected rollback failure, and the old close path committed its row. Draft follow-up #238 (head 8135bcf) avoids unsafe close, retries rollback once, and treats failed/no-op abort as unsafe to close. Targeted tests and the full Java-to-SQLite reactor pass locally (SQLite 293 passed, 1 skipped). This remains review-only; driver/pool behavior must be reviewed before integrating #236/#238.