openEQUELLA icon indicating copy to clipboard operation
openEQUELLA copied to clipboard

Potential connection leak

Open abidingotter opened this issue 5 years ago • 1 comments

Describe the bug In RunWithDB.scala there is code that attempts to commit or rollback a transaction but does not catch any exceptions, so the close call could be missed. It doesn't seem to be causing any issues at the moment, but could potentially.

val connection = ds.getConnection()
    jdbc.runA(connection).attempt.unsafeRunSync() match {
      case Left(e)  => connection.rollback(); connection.close(); throw e
      case Right(v) => connection.commit(); connection.close(); v
    }

Platform:

  • OpenEquella Version: 6.6+

abidingotter avatar Aug 09 '19 02:08 abidingotter