From 17261bbf1552205e02d8c28c02c0783a16a502c6 Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 18 Sep 2023 14:37:43 +0200 Subject: [PATCH 1/2] feature/throw obp exception earlier, instead of StackOverflowError. --- obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala index 07904025c3..5883715db2 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala @@ -96,8 +96,8 @@ trait CustomProtoDBVendor extends ConnectionManager { logger.debug("Temporarily expanding pool. name=%s, tempMaxSize=%d".format(name, tempMaxSize)) newConnection(name) }else{ - logger.debug(s"The poolSize is expanding to tempMaxSize ($tempMaxSize), we can not create new connection, need to restart OBP now.") - throw new RuntimeException(s"Database may be down, please check database connection! OBP already create $tempMaxSize connections, because all connections are occupied!") + logger.error(s"The poolSize is expanding to tempMaxSize ($tempMaxSize), we can not create new connection, need to restart OBP now.") + Failure(s"Database may be down, please check database connection! OBP already create $tempMaxSize connections, because all connections are occupied!") } case x :: xs => From a41c0f1782896c908dd9e6af4271264928600c32 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 19 Sep 2023 11:34:14 +0200 Subject: [PATCH 2/2] feature/chang the default poolSize --- .../src/main/scala/bootstrap/liftweb/CustomDBVendor.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala index 5883715db2..e9f5331d4d 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala @@ -47,15 +47,15 @@ trait CustomProtoDBVendor extends ConnectionManager { /** * Override this method if you want something other than - * 4 connections in the pool + * 20 connections in the pool */ - protected def maxPoolSize = 4 + protected def maxPoolSize = 20 /** * The absolute maximum that this pool can extend to - * The default is 20. Override this method to change. + * The default is 40. Override this method to change. */ - protected def doNotExpandBeyond = 20 + protected def doNotExpandBeyond = 30 /** * The logic for whether we can expand the pool beyond the current size. By