use of org.infinispan.persistence.jdbc.common.impl.connectionfactory.SimpleConnectionFactory in project infinispan by infinispan.
the class UnitTestDatabaseManager method verifyConnectionLeaks.
public static void verifyConnectionLeaks(ConnectionFactory connectionFactory) {
if (connectionFactory instanceof PooledConnectionFactory) {
PooledConnectionFactory pcf = (PooledConnectionFactory) connectionFactory;
try {
// C3P0 needs a little delay before reporting the correct number of connections. Bah!
Thread.sleep(500);
assertEquals(pcf.getActiveConnections(), 0);
} catch (Exception e) {
throw new RuntimeException(e);
}
} else if (connectionFactory instanceof SimpleConnectionFactory) {
SimpleConnectionFactory scf = (SimpleConnectionFactory) connectionFactory;
assertEquals(scf.getConnectionCount(), 0);
}
}
use of org.infinispan.persistence.jdbc.common.impl.connectionfactory.SimpleConnectionFactory in project infinispan by infinispan.
the class StringStoreWithManagedConnectionFunctionalTest method getConnectionFactory.
@Override
protected ConnectionFactory getConnectionFactory(JdbcStringBasedStoreConfigurationBuilder storeBuilder) {
SimpleConnectionFactory simpleFactory = new SimpleConnectionFactory();
simpleFactory.start(configureSimpleConnectionFactory(storeBuilder).create(), Thread.currentThread().getContextClassLoader());
return simpleFactory;
}
Aggregations