use of org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl in project ignite by apache.
the class HibernateL2CacheTransactionalSelfTest method registryBuilder.
/** {@inheritDoc} */
@Nullable
@Override
protected StandardServiceRegistryBuilder registryBuilder() {
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
DatasourceConnectionProviderImpl connProvider = new DatasourceConnectionProviderImpl();
// JTA-aware data source.
BasicManagedDataSource dataSrc = new BasicManagedDataSource();
dataSrc.setTransactionManager(jotm.getTransactionManager());
dataSrc.setDefaultAutoCommit(false);
JdbcDataSource h2DataSrc = new JdbcDataSource();
h2DataSrc.setURL(CONNECTION_URL);
dataSrc.setXaDataSourceInstance(h2DataSrc);
connProvider.setDataSource(dataSrc);
connProvider.configure(Collections.emptyMap());
builder.addService(ConnectionProvider.class, connProvider);
builder.addService(JtaPlatform.class, new TestJtaPlatform());
builder.applySetting(Environment.TRANSACTION_COORDINATOR_STRATEGY, JtaTransactionCoordinatorBuilderImpl.class.getName());
return builder;
}
use of org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl in project dropwizard by dropwizard.
the class SessionFactoryFactory method buildConnectionProvider.
private ConnectionProvider buildConnectionProvider(DataSource dataSource, Map<String, String> properties) {
final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
connectionProvider.setDataSource(dataSource);
connectionProvider.configure(properties);
return connectionProvider;
}
Aggregations