use of org.hibernate.service.spi.Stoppable in project hibernate-orm by hibernate.
the class BaseTransactionIsolationConfigTest method testSettingIsolationAsName.
@Test
public void testSettingIsolationAsName() throws Exception {
Properties properties = Environment.getProperties();
augmentConfigurationSettings(properties);
properties.put(AvailableSettings.ISOLATION, "TRANSACTION_SERIALIZABLE");
ConnectionProvider provider = getConnectionProviderUnderTest();
try {
((Configurable) provider).configure(properties);
if (Startable.class.isInstance(provider)) {
((Startable) provider).start();
}
Connection connection = provider.getConnection();
assertEquals(Connection.TRANSACTION_SERIALIZABLE, connection.getTransactionIsolation());
provider.closeConnection(connection);
} finally {
((Stoppable) provider).stop();
}
}
use of org.hibernate.service.spi.Stoppable in project hibernate-orm by hibernate.
the class BaseTransactionIsolationConfigTest method testSettingIsolationAsNameAlt.
@Test
public void testSettingIsolationAsNameAlt() throws Exception {
Properties properties = Environment.getProperties();
augmentConfigurationSettings(properties);
properties.put(AvailableSettings.ISOLATION, "SERIALIZABLE");
ConnectionProvider provider = getConnectionProviderUnderTest();
try {
((Configurable) provider).configure(properties);
if (Startable.class.isInstance(provider)) {
((Startable) provider).start();
}
Connection connection = provider.getConnection();
assertEquals(Connection.TRANSACTION_SERIALIZABLE, connection.getTransactionIsolation());
provider.closeConnection(connection);
} finally {
((Stoppable) provider).stop();
}
}
use of org.hibernate.service.spi.Stoppable in project hibernate-orm by hibernate.
the class BaseTransactionIsolationConfigTest method testSettingIsolationAsNumericString.
@Test
public void testSettingIsolationAsNumericString() throws Exception {
Properties properties = Environment.getProperties();
augmentConfigurationSettings(properties);
properties.put(AvailableSettings.ISOLATION, Integer.toString(Connection.TRANSACTION_SERIALIZABLE));
ConnectionProvider provider = getConnectionProviderUnderTest();
try {
((Configurable) provider).configure(properties);
if (Startable.class.isInstance(provider)) {
((Startable) provider).start();
}
Connection connection = provider.getConnection();
assertEquals(Connection.TRANSACTION_SERIALIZABLE, connection.getTransactionIsolation());
provider.closeConnection(connection);
} finally {
((Stoppable) provider).stop();
}
}
use of org.hibernate.service.spi.Stoppable 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(properties);
if (Startable.class.isInstance(provider)) {
((Startable) provider).start();
}
Connection connection = provider.getConnection();
assertEquals(Connection.TRANSACTION_SERIALIZABLE, connection.getTransactionIsolation());
provider.closeConnection(connection);
} finally {
((Stoppable) provider).stop();
}
}
Aggregations