Interface PooledConnectionMBean

  • All Known Implementing Classes:
    PooledConnection

    public interface PooledConnectionMBean
    JMX MBean interface for monitoring and managing pooled connections.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearWarnings()
      Clears any warnings reported on this connection.
      boolean getAutoCommit()
      Returns the current auto-commit mode.
      java.lang.String getCatalog()
      Returns the current catalog name.
      long getConnectionVersion()
      Returns the connection version: the pool purge generation in force when this pooled connection was created.
      int getHoldability()
      Returns the current holdability for ResultSet objects.
      long getLastConnected()
      Returns the timestamp of the last successful connection, or -1 when this pooled connection currently has no physical session - never connected, disconnected, or mid-reconnect.
      long getLastValidated()
      Returns the timestamp at which the last successful validation completed on the current physical session.
      java.lang.String getSchema()
      Returns the current schema name.
      long getTimestamp()
      Returns the timestamp of the last pool action on this connection.
      int getTransactionIsolation()
      Returns the current transaction isolation level.
      boolean isClosed()
      Returns true if the connection has been closed, including the case where the pooled connection currently has no physical session.
      boolean isDiscarded()
      Returns true if the connection has been discarded.
      boolean isInitialized()
      Returns true if the connection has been initialized.
      boolean isMaxAgeExpired()
      Returns true if the connection has exceeded its maximum age.
      boolean isReadOnly()
      Returns true if the connection is in read-only mode.
      boolean isReleased()
      Returns true if the connection has been released.
      boolean isSuspect()
      Returns true if the connection is suspected to be invalid.
    • Method Detail

      • getConnectionVersion

        long getConnectionVersion()
        Returns the connection version: the pool purge generation in force when this pooled connection was created. The pool counter is seeded from Long.MIN_VALUE, so a connection created against a freshly started pool reports a large negative number; it is not a connection age and not a version of the driver. Connections older than the pool's current generation are retired by the pool as they are used or swept.
        Returns:
        the pool purge generation at connection creation
      • isInitialized

        boolean isInitialized()
        Returns true if the connection has been initialized.
        Returns:
        true if initialized
      • isMaxAgeExpired

        boolean isMaxAgeExpired()
        Returns true if the connection has exceeded its maximum age. When a maximum age is configured, a connection that currently has no physical session - see getLastConnected() - also returns true, as a session that is not connected is never young enough to keep; without a configured maximum age this attribute always reports false.
        Returns:
        true if max age expired
      • isSuspect

        boolean isSuspect()
        Returns true if the connection is suspected to be invalid.
        Returns:
        true if suspect
      • getTimestamp

        long getTimestamp()
        Returns the timestamp of the last pool action on this connection. Timestamps are set when the pool hands the connection out or takes it back, and the value drives the abandoned-connection check - it is also reset by the ResetAbandonedTimer interceptor on application calls, which additionally clears the suspect flag, so a reset need not be a pool action. The value starts at the time this pooled connection was created.
        Returns:
        the timestamp of the last pool action as defined by System.currentTimeMillis()
      • isDiscarded

        boolean isDiscarded()
        Returns true if the connection has been discarded.
        Returns:
        true if discarded
      • getLastValidated

        long getLastValidated()
        Returns the timestamp at which the last successful validation completed on the current physical session. While that session has not been validated it reports 0, so a validation inherited from the session a reconnect replaced cannot be mistaken for one of this session. Before any session has been established, it reports the time this pooled connection was created.
        Returns:
        the last validated timestamp as defined by System.currentTimeMillis(), or 0 while the current session has not been validated
      • getLastConnected

        long getLastConnected()
        Returns the timestamp of the last successful connection, or -1 when this pooled connection currently has no physical session - never connected, disconnected, or mid-reconnect.
        Returns:
        the last connected timestamp as defined by System.currentTimeMillis(), or -1
      • isReleased

        boolean isReleased()
        Returns true if the connection has been released.
        Returns:
        true if released
      • clearWarnings

        void clearWarnings()
                    throws java.sql.SQLException
        Clears any warnings reported on this connection. The operation reaches a live session whether or not it is currently borrowed, so warnings an application has not yet read are cleared as well. It is a no-op while the pooled connection has no physical session.
        Throws:
        java.sql.SQLException - if the driver refuses to clear the warnings, so a JMX client can tell a refused clear from a completed one
      • isClosed

        boolean isClosed()
                  throws java.sql.SQLException
        Returns true if the connection has been closed, including the case where the pooled connection currently has no physical session.
        Returns:
        true if closed
        Throws:
        java.sql.SQLException - if the physical connection reports a failure
      • getAutoCommit

        boolean getAutoCommit()
                       throws java.sql.SQLException
        Returns the current auto-commit mode.
        Returns:
        the auto-commit mode
        Throws:
        java.sql.SQLException - if a database access error occurs
      • getCatalog

        java.lang.String getCatalog()
                             throws java.sql.SQLException
        Returns the current catalog name.
        Returns:
        the catalog name
        Throws:
        java.sql.SQLException - if a database access error occurs
      • getHoldability

        int getHoldability()
                    throws java.sql.SQLException
        Returns the current holdability for ResultSet objects.
        Returns:
        the holdability
        Throws:
        java.sql.SQLException - if a database access error occurs
      • isReadOnly

        boolean isReadOnly()
                    throws java.sql.SQLException
        Returns true if the connection is in read-only mode.
        Returns:
        true if read-only
        Throws:
        java.sql.SQLException - if a database access error occurs
      • getSchema

        java.lang.String getSchema()
                            throws java.sql.SQLException
        Returns the current schema name.
        Returns:
        the schema name
        Throws:
        java.sql.SQLException - if a database access error occurs
      • getTransactionIsolation

        int getTransactionIsolation()
                             throws java.sql.SQLException
        Returns the current transaction isolation level.
        Returns:
        the transaction isolation level
        Throws:
        java.sql.SQLException - if a database access error occurs