Make Savepoint rollbacks mark the connection dirty (#2149)

Addresses https://github.com/brettwooldridge/HikariCP/issues/2142
pull/2241/head
Carl Mastrangelo 4 months ago committed by GitHub
parent a671b6e24d
commit 4f6b295e14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -392,7 +392,7 @@ public abstract class ProxyConnection implements Connection
public void rollback(Savepoint savepoint) throws SQLException public void rollback(Savepoint savepoint) throws SQLException
{ {
delegate.rollback(savepoint); delegate.rollback(savepoint);
isCommitStateDirty = false; isCommitStateDirty = true;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */

@ -160,7 +160,7 @@ public class ConnectionStateTest
assertTrue(TestElf.getConnectionCommitDirtyState(connection)); assertTrue(TestElf.getConnectionCommitDirtyState(connection));
connection.rollback(null); connection.rollback(null);
assertFalse(TestElf.getConnectionCommitDirtyState(connection)); assertTrue(TestElf.getConnectionCommitDirtyState(connection));
resultSet.updateRow(); resultSet.updateRow();
assertTrue(TestElf.getConnectionCommitDirtyState(connection)); assertTrue(TestElf.getConnectionCommitDirtyState(connection));

Loading…
Cancel
Save