Skip to content

Commit

Permalink
configure agroal connection pool (TEAMMATES#12971)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricongjh authored and xenosf committed Mar 29, 2024
1 parent 028c953 commit 3fed2da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ dependencies {
implementation("org.jsoup:jsoup:1.15.2")
implementation("org.hibernate.orm:hibernate-core:6.1.6.Final")
implementation("org.postgresql:postgresql:42.7.2")
implementation("org.hibernate:hibernate-hikaricp:6.1.6.Final")
implementation("org.hibernate.orm:hibernate-agroal:6.1.6.Final")
implementation("io.agroal:agroal-pool:2.1")

testAnnotationProcessor(testng)

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/teammates/common/util/HibernateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ public static void buildSessionFactory(String dbUrl, String username, String pas
.setProperty("hibernate.hbm2ddl.auto", "validate")
.setProperty("show_sql", "true")
.setProperty("hibernate.current_session_context_class", "thread")
.setProperty("hibernate.hikari.minimumIdle", "10")
.setProperty("hibernate.hikari.maximumPoolSize", "30")
.setProperty("hibernate.hikari.idleTimeout", "300000")
.setProperty("hibernate.hikari.connectionTimeout", "30000")
.setProperty("hibernate.agroal.minSize", "5")
.setProperty("hibernate.agroal.maxSize", "50")
.setProperty("hibernate.agroal.reapTimeout", "PT1M")
// Uncomment only during migration for optimized batch-insertion, batch-update, and batch-fetch.
// .setProperty("hibernate.jdbc.batch_size", "50")
// .setProperty("hibernate.order_updates", "true")
Expand Down

0 comments on commit 3fed2da

Please sign in to comment.