Search in sources :

Example 1 with DefaultSqlClientPool

use of org.hibernate.reactive.pool.impl.DefaultSqlClientPool in project hibernate-reactive by hibernate.

the class ReactiveConnectionPoolTest method configureAndStartPool.

private ReactiveConnectionPool configureAndStartPool(Map<String, Object> config) {
    DefaultSqlClientPoolConfiguration poolConfig = new DefaultSqlClientPoolConfiguration();
    poolConfig.configure(config);
    registryRule.addService(SqlClientPoolConfiguration.class, poolConfig);
    registryRule.addService(JdbcServices.class, new JdbcServicesImpl() {

        @Override
        public SqlStatementLogger getSqlStatementLogger() {
            return new SqlStatementLogger();
        }
    });
    DefaultSqlClientPool reactivePool = new DefaultSqlClientPool();
    reactivePool.injectServices(registryRule.getServiceRegistry());
    reactivePool.configure(config);
    reactivePool.start();
    return reactivePool;
}
Also used : JdbcServicesImpl(org.hibernate.engine.jdbc.internal.JdbcServicesImpl) DefaultSqlClientPool(org.hibernate.reactive.pool.impl.DefaultSqlClientPool) DefaultSqlClientPoolConfiguration(org.hibernate.reactive.pool.impl.DefaultSqlClientPoolConfiguration) SqlStatementLogger(org.hibernate.engine.jdbc.spi.SqlStatementLogger)

Aggregations

JdbcServicesImpl (org.hibernate.engine.jdbc.internal.JdbcServicesImpl)1 SqlStatementLogger (org.hibernate.engine.jdbc.spi.SqlStatementLogger)1 DefaultSqlClientPool (org.hibernate.reactive.pool.impl.DefaultSqlClientPool)1 DefaultSqlClientPoolConfiguration (org.hibernate.reactive.pool.impl.DefaultSqlClientPoolConfiguration)1