1 Reply Latest reply on May 25, 2017 11:43 AM by as0045500

    Q2 2017 - "A connection was left open"


      I have a building block I wrote against Q2 2016, and with some assistance from our great developer community, I had found that I couldn't simply close the connection using con.close(), but I had to use ConnectionManager.ReleaseDefaultConnection(con) to actually close the connection.  My building block has been working great in Q2 2016, but now I've upgraded our test instance to Q2 2017, and I'm once again getting "A connection was left open" warnings in my bb-services log.  There's another error appearing, immediately before this error:


      “Automatically closing connection that was opened by: - java.lang.Exception”


      But there's none of my code referenced in the stack trace, and I'm not sure why that would be leaving the connection open, nor how to close it.  I once again turn to your collective wisdom to figure out how to make sure these connections are being closed.

        • Re: Q2 2017 - "A connection was left open"



          I  just checked the log on my enviroment and got this error:


          "2017-05-25 12:18:21 -0300 - Request left a connection open: /webapps/******/GetUserInfo To debug, _temporarily_ add this line to your action: DatabaseContainer.getDefaultInstance().getBbDatabase().getConnectionManager().setTraceConnectionOpeners( true );  and you will get a full stack dump locating where the connection was created. "

          Will change the "con.close" to what you suggested and check the log again.