public OPartitionedDatabasePool get(final String url, final String userName, final String userPassword) {
checkForClose();
final PoolIdentity poolIdentity = new PoolIdentity(url, userName, userPassword);
OPartitionedDatabasePool pool = poolStore.get(poolIdentity);
if (pool != null && !pool.isClosed())
return pool;
if (pool != null)
poolStore.remove(poolIdentity, pool);
while (true) {
pool = new OPartitionedDatabasePool(url, userName, userPassword, 8, maxPoolSize);
final OPartitionedDatabasePool oldPool = poolStore.putIfAbsent(poolIdentity, pool);
if (oldPool != null) {
if (!oldPool.isClosed()) {
return oldPool;
} else {
poolStore.remove(poolIdentity, oldPool);
}
} else {
return pool;
}
}
}