1 Reply Latest reply on Oct 9, 2009 5:57 PM by lpmon

    AS 5.1 - ResultSet closed, worked fine in 4.0.5

    lpmon Novice

      I have a session been that takes an SQL select query string (not EJBQL), runs the query and returns the resultset. This worked fine in 4.0.5. In 5.1.0 the resultset is open inside the session bean method but when trying to access the result set (rs.next()) in the method that called the session bean an exception is thrown saying the result set is closed. Something in either the AS or Hibernate must have changed for 5.x . ??????

      More info: The session bean looks up a non-transactional JDBC datasource (regular pooled connection), creates a connection, creates a statement and executes that statement.

      Again, exact same code works just fine in 4.0.5. There is no problem accessing the resultset inside the session bean it is only when you return the resultset and try to access it in the caller of the session bean that the problem occurs.

      Is this a bug or have the rules changed?

        • 1. Re: AS 5.1 - ResultSet closed, worked fine in 4.0.5
          lpmon Novice

          This is crazy. We moved the code outside of the session bean and all works just fine.

          Is there a rule that says:

          If you create a ResultSet inside a session bean that you cannot return to a non-session bean caller?

          If someone answers this question 'yes' then: How is it that I have been doing this exact thing for a long time with no problems. The problem only surfaced when I moved from 4.0.5 to 5.1.0. ??????

          Restating: this is not an EJB3 resultset, just a simple JDBC Resultset. All indications are that when the session bean method exits something is closing the ResultSet.