diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index bd6c3deb64..8976c16567 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -683,7 +683,7 @@ class Boot extends MdcLoggable { // Make a transaction span the whole HTTP request S.addAround(DB.buildLoanWrapper) - logger.info("Note: Http request is in one database transaction.") + logger.info("Note: We added S.addAround(DB.buildLoanWrapper) so each HTTP request uses ONE database transaction.") try { val useMessageQueue = APIUtil.getPropsAsBoolValue("messageQueue.createBankAccounts", false) diff --git a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala index be5b72e564..0365acd6b0 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala @@ -49,8 +49,11 @@ class CustomDBVendor(driverName: String, if(maxLifetime.isDefined){ config.setMaxLifetime(maxLifetime.head) } - //Liftweb DB.scala will set all the new connections to false, so here we set default to false - config.setAutoCommit(true) + //Liftweb DB.scala will set all the new connections to false, so here we set default to false - Hmm, check this comment! + val autoCommitValue: Boolean = true + config.setAutoCommit(autoCommitValue) + logger.info(s"We set HikariDatasource config.setAutoCommit=$autoCommitValue") + logger.info(s"Note: HirakiCP will reset any connection to autoCommit=$autoCommitValue when it returns it to the pool if it has been otherwise set in code. (This can cause further debug messages and some performance impact.)") (dbUser, dbPassword) match { case (Full(user), Full(pwd)) => diff --git a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala index c764d5762e..15c89a78d4 100644 --- a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala +++ b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala @@ -19,8 +19,8 @@ object ErrorMessages { // 3) Before adding a new message, check that you can't use one that already exists. // 4) Use Proper Names for OBP Resources. // 5) Don't use abbreviations. - // 6) Any messaage defined here should be considered "fair game" to return over the API. Thus: - // 7) Since the existance of "OBP-..." in a message is used to determine if we should display to a user if display_internal_errors=false, do *not* concatenate internal or core banking system error messages to these strings. + // 6) Any message defined here should be considered "fair game" to return over the API. Thus: + // 7) Since the existence of "OBP-..." in a message is used to determine if we should display to a user if display_internal_errors=false, do *not* concatenate internal or core banking system error messages to these strings. def apiFailureToString(code: Int, message: String, context: Option[CallContext]): String = JsonAST.compactRender(