diff --git a/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java b/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java index 81ae4fd3..f064f9c7 100644 --- a/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java +++ b/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java @@ -430,7 +430,6 @@ public abstract class ProxyConnection implements Connection { delegate.setReadOnly(readOnly); isReadOnly = readOnly; - isCommitStateDirty = false; dirtyBits |= DIRTY_BIT_READONLY; } diff --git a/src/test/java/com/zaxxer/hikari/pool/ConnectionStateTest.java b/src/test/java/com/zaxxer/hikari/pool/ConnectionStateTest.java index 5599bee4..b2da043b 100644 --- a/src/test/java/com/zaxxer/hikari/pool/ConnectionStateTest.java +++ b/src/test/java/com/zaxxer/hikari/pool/ConnectionStateTest.java @@ -164,6 +164,9 @@ public class ConnectionStateTest resultSet.updateRow(); assertTrue(TestElf.getConnectionCommitDirtyState(connection)); + + connection.setReadOnly(!connection.isReadOnly()); + assertTrue(TestElf.getConnectionCommitDirtyState(connection)); } } }