Search in sources :

Example 6 with ConnectionProvider

use of org.jooq.ConnectionProvider in project jOOQ by jOOQ.

the class DefaultConfiguration method connectionProvider.

// -------------------------------------------------------------------------
// XXX: Getters
// -------------------------------------------------------------------------
@Override
public final ConnectionProvider connectionProvider() {
    // [#3229] [#5377] If we're currently in a transaction, return that transaction's
    // local DefaultConnectionProvider, not the one from this configuration
    TransactionProvider tp = transactionProvider();
    ConnectionProvider transactional = tp instanceof ThreadLocalTransactionProvider ? ((ThreadLocalTransactionProvider) tp).localConnectionProvider : (ConnectionProvider) data(DATA_DEFAULT_TRANSACTION_PROVIDER_CONNECTION);
    return transactional != null ? transactional : connectionProvider != null ? connectionProvider : new NoConnectionProvider();
}
Also used : TransactionProvider(org.jooq.TransactionProvider) ThreadLocalConnectionProvider(org.jooq.impl.ThreadLocalTransactionProvider.ThreadLocalConnectionProvider) ConnectionProvider(org.jooq.ConnectionProvider)

Aggregations

ConnectionProvider (org.jooq.ConnectionProvider)6 DSLContext (org.jooq.DSLContext)3 Configuration (org.jooq.Configuration)2 DataSourceConnectionProvider (org.jooq.impl.DataSourceConnectionProvider)2 DefaultConfiguration (org.jooq.impl.DefaultConfiguration)2 ConnectionFactory (io.r2dbc.spi.ConnectionFactory)1 Vertx (io.vertx.core.Vertx)1 HikariCpPool (io.vertx.tp.hikari.HikariCpPool)1 Plugin (io.vertx.up.annotations.Plugin)1 Plugins (io.vertx.up.eon.Plugins)1 Fn (io.vertx.up.func.Fn)1 Infix (io.vertx.up.plugin.Infix)1 Instance (io.vertx.up.tool.mirror.Instance)1 Properties (java.util.Properties)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 DataSource (javax.sql.DataSource)1 BasicDataSource (org.apache.commons.dbcp.BasicDataSource)1 JSONFormat (org.jooq.JSONFormat)1 SQLDialect (org.jooq.SQLDialect)1