Class SqlClientPool

  • All Implemented Interfaces:
    java.io.Serializable, ReactiveConnectionPool, org.hibernate.service.Service
    Direct Known Subclasses:
    DefaultSqlClientPool, ExternalSqlClientPool

    public abstract class SqlClientPool
    extends java.lang.Object
    implements ReactiveConnectionPool
    A pool of reactive connections backed by a supplier of Vert.x Pool instances.

    The Vert.x notion of pool is not to be confused with the traditional JDBC notion of a connection pool: there is a fundamental difference as the Vert.x pool should not be shared across threads or with other Vert.x contexts.

    Therefore, the reactive SessionFactory doesn't retain a single instance of Pool, but rather has a supplier which produces a new Pool within each context.

    See Also:
    the default implementation, the implementation used in Quarkus, Serialized Form
    • Constructor Detail

      • SqlClientPool

        public SqlClientPool()
    • Method Detail

      • getPool

        protected abstract io.vertx.sqlclient.Pool getPool()
        Returns:
        the underlying Vert.x Pool for the current context.
      • getSqlStatementLogger

        protected abstract org.hibernate.engine.jdbc.spi.SqlStatementLogger getSqlStatementLogger()
        Returns:
        a Hibernate SqlStatementLogger for logging SQL statements as they are executed
      • getTenantPool

        protected io.vertx.sqlclient.Pool getTenantPool​(java.lang.String tenantId)
        Get a Pool for the specified tenant.

        This is an unimplemented operation which must be overridden by subclasses which support multitenancy.

        Parameters:
        tenantId - the id of the tenant
        Throws:
        java.lang.UnsupportedOperationException - if multitenancy is not supported
        See Also:
        getConnection(String)