use of org.hibernate.engine.jdbc.connections.spi.ConnectionProvider in project hibernate-orm by hibernate.
the class BaseTransactionIsolationConfigTest method testSettingIsolationAsNumeric.
@Test
public void testSettingIsolationAsNumeric() throws Exception {
Properties properties = Environment.getProperties();
augmentConfigurationSettings(properties);
properties.put(AvailableSettings.ISOLATION, Connection.TRANSACTION_SERIALIZABLE);
ConnectionProvider provider = getConnectionProviderUnderTest();
try {
((Configurable) provider).configure(PropertiesHelper.map(properties));
if (provider instanceof Startable) {
((Startable) provider).start();
}
Connection connection = provider.getConnection();
assertEquals(Connection.TRANSACTION_SERIALIZABLE, connection.getTransactionIsolation());
provider.closeConnection(connection);
} finally {
((Stoppable) provider).stop();
}
}
Aggregations