IGNITE-5426: JdbcThinConnection.readOnly state propagation. This closes #2200.
authortledkov-gridgain <tledkov@gridgain.com>
Wed, 5 Jul 2017 08:18:48 +0000 (11:18 +0300)
committerdevozerov <vozerov@gridgain.com>
Wed, 5 Jul 2017 08:18:48 +0000 (11:18 +0300)
modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java

index 14c34ee..89ef2fc 100644 (file)
@@ -76,6 +76,9 @@ public class JdbcThinConnection implements Connection {
     /** Auto commit flag. */
     private boolean autoCommit;
 
+    /** Read-only flag. */
+    private boolean readOnly;
+
     /** Current transaction holdability. */
     private int holdability;
 
@@ -277,13 +280,15 @@ public class JdbcThinConnection implements Connection {
     /** {@inheritDoc} */
     @Override public void setReadOnly(boolean readOnly) throws SQLException {
         ensureNotClosed();
+
+        this.readOnly = readOnly;
     }
 
     /** {@inheritDoc} */
     @Override public boolean isReadOnly() throws SQLException {
         ensureNotClosed();
 
-        return true;
+        return readOnly;
     }
 
     /** {@inheritDoc} */