Interface IgniteJdbcConnection

All Superinterfaces:
AutoCloseable, Connection, Wrapper

public interface IgniteJdbcConnection extends Connection
Extension of the Connection interface that exposes Ignite-specific configuration options.

Use Wrapper.unwrap(Class) to obtain an instance of this interface from a standard Connection:


 Connection conn = ...
 conn.unwrap(IgniteJdbcConnection.class)
     .setTransactionTimeout(5000L);
 
  • Method Details

    • getTransactionTimeout

      long getTransactionTimeout() throws SQLException
      Returns the transaction timeout, in milliseconds, applied to transactions started on this connection.
      Returns:
      Transaction timeout in milliseconds, or 0 if the cluster-wide default is used.
      Throws:
      SQLException
    • setTransactionTimeout

      void setTransactionTimeout(@Nullable @Nullable Long timeout) throws SQLException
      Sets the transaction timeout, in milliseconds, for transactions started on this connection. Overrides the value supplied via the transactionTimeoutMillis connection property. The new value applies to transactions started after this call; transactions already in progress are not affected.
      Parameters:
      timeout - Transaction timeout in milliseconds, or null (or 0) to use the cluster-wide default.
      Throws:
      SQLException - On error.
    • isAllowFollowerReads

      @Nullable @Nullable Boolean isAllowFollowerReads() throws SQLException
      Returns whether read-only SQL statements executed on this connection may read data from non-primary replicas.
      Returns:
      True if read from non-primary replicas is allowed for the connection, false if disallowed, null if the cluster-wide setting is used (default behavior).
      Throws:
      SQLException - On error.
    • setAllowFollowerReads

      void setAllowFollowerReads(@Nullable @Nullable Boolean allowFollowerReads) throws SQLException
      Sets whether read-only SQL statements executed on this connection may read data from non-primary replicas.
      Parameters:
      allowFollowerReads - True to allow read from non-primary replicas for the connection, false to disallow, null to use the cluster-wide setting (default behavior).
      Throws:
      SQLException - On error.