1
0
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:
Julien Kirch
2023-10-09 14:05:13 +02:00
committed by GitHub
parent 0351f94761
commit f9b5a5212d
2 changed files with 7 additions and 1 deletions

View File

@@ -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;
}