AnsweredAssumed Answered

Request left a connection open

Question asked by cf26721 on Mar 30, 2017
Latest reply on Mar 31, 2017 by cf26721

I have a B2 where I'm calling a stored procedure, and pulling data from the recordset.  My code appears to be closing everything, but the bb-services log states otherwise.

 

CallableStatement cs = null;
  Connection con = null;
  try {
  con = ConnectionManager.getDefaultConnection();
  cs = con.prepareCall("{call usp_TestSproc(?,?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

  cs.setInt(1, users_pk1);
  cs.setInt(2, crsmain_pk1);

  LOGGER.trace("Executing the stored procedure");
  ResultSet rs = cs.executeQuery();

  while (rs.next()) {
  LOGGER.trace("Looping through the recordset");
    message_pk1s.add(rs.getInt("message_pk1"));
  }
  rs.close();


  } catch (ConnectionNotAvailableException e) {
  LOGGER.error("The connect to the database is not currently available: " + e.getLocalizedMessage(), e);
  } catch (SQLException e) {
  LOGGER.error("An SQL exception has occurred: " + e.getLocalizedMessage(), e);
  } finally {
  try {
  LOGGER.error("Closing the connections.");
  cs.close();
  con.close();
  } catch (SQLException e) {
allableStatement: " + e.getLocalizedMessage(), e);
  }
  }

 

What am I missing?

 

The error showing up is:

2017-03-30 08:53:37 -0500 - Request left a connection open: /webapps/portal/execute/tabs/tabAction?tab_tab_group_id=_1_1 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.

 

I've looked at the dump, and can't find anything.

Outcomes