mirror of
https://github.com/sismics/docs.git
synced 2025-12-15 10:46:26 +00:00
Allow to specify a pool size (#727)
This commit is contained in:
@@ -79,6 +79,10 @@ public final class EMF {
|
||||
String databaseUrl = System.getenv("DATABASE_URL");
|
||||
String databaseUsername = System.getenv("DATABASE_USER");
|
||||
String databasePassword = System.getenv("DATABASE_PASSWORD");
|
||||
String databasePoolSize = System.getenv("DATABASE_POOL_SIZE");
|
||||
if(databasePoolSize == null) {
|
||||
databasePoolSize = "10";
|
||||
}
|
||||
|
||||
log.info("Configuring EntityManager from environment parameters");
|
||||
Properties props = new Properties();
|
||||
@@ -103,7 +107,7 @@ public final class EMF {
|
||||
props.put("hibernate.max_fetch_depth", "5");
|
||||
props.put("hibernate.cache.use_second_level_cache", "false");
|
||||
props.put("hibernate.connection.initial_pool_size", "1");
|
||||
props.put("hibernate.connection.pool_size", "10");
|
||||
props.put("hibernate.connection.pool_size", databasePoolSize);
|
||||
props.put("hibernate.connection.pool_validation_interval", "5");
|
||||
return props;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user