String shared = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_SHARED, m, session);
boolean isShared = false;
if (shared != null) {
isShared = Boolean.parseBoolean(shared);
}
ConnectionPool pool = null;
if (isShared) {
pool = new ReadConnectionPool("read", this.session.getReadConnectionPool().getLogin(), this.session);
} else {
pool = new ConnectionPool("read", this.session.getReadConnectionPool().getLogin(), this.session);
}
String min = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_MIN, m, session);
if (min != null) {
pool.setMinNumberOfConnections(Integer.parseInt(min));
}
String max = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_MAX, m, session);
if (max != null) {
pool.setMaxNumberOfConnections(Integer.parseInt(max));
}
String initial = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_INITIAL, m, session);
if (initial != null) {
pool.setInitialNumberOfConnections(Integer.parseInt(initial));
}
// Only set the read pool if they configured it, otherwise use default shared read/write.
if (isShared || (min != null) || (max != null) || (initial != null)) {
this.session.setReadConnectionPool(pool);
}
String wait = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_CONNECTIONS_WAIT, m, session);
if (wait != null) {
session.getDefaultConnectionPool().setWaitTimeout(Integer.parseInt(wait));
pool.setWaitTimeout(Integer.parseInt(wait));
}
}
// Configure sequence connection pool if set.
String sequence = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.JDBC_SEQUENCE_CONNECTION_POOL, m, session);