use of org.jooq.impl.DefaultTransactionProvider in project keywhiz by square.
the class ServiceModule method readonlyJooqContext.
@Provides
@Singleton
@Readonly
DSLContext readonlyJooqContext(@Readonly ManagedDataSource dataSource) throws SQLException {
DSLContext dslContext = DSLContexts.databaseAgnostic(dataSource);
org.jooq.Configuration configuration = dslContext.configuration();
// Disable support for nested transactions via savepoints (required for MySQL)
// See: https://groups.google.com/forum/#!topic/jooq-user/zG0U6CkxI5o
configuration.set(new DefaultTransactionProvider(configuration.connectionProvider(), false));
return dslContext;
}
Aggregations