4 Replies Latest reply on Jan 19, 2006 1:00 PM by Adrian Brock

    ManagedConnectionPool behaviour inconsistencies between 3.2.

    Bob Smith Newbie

      Hello,

      JBossManagedConnectionPool is behaving differently between 3.2.6 and 4.0.2.

      I have an application that is using MySQL streaming result sets. The MySQL version is 4.0.20a and the Connector/J version is 3.1.6.

      In some cases I have embedded queries. In other words, I scroll through the first result set and, for each row, perform another query that also returns a streaming result set. When performing this second (embedded) query, the DataSource is asked for a connection. In JBoss 3.2.6 it gives me a new connection, i.e. not the one associated with the outer result set. In JBoss 4.0.2 it gives me the same connection [getUnderlyingConnection() was used to determine this]. Because MySQL stipulates you cannot have more than one streaming result set in use on the same connection, the code fails on JBoss version 4.0.2.

      I thought that maybe class implementing ManagedConnectionPool had changed between the versions, but it appears to be JBossManagedConnectionPool in both cases.

      So perhaps the code has changed between the versions - but on looking at JBossManagedConnectionPool.java, it is the same in both 3.2.6 and 4.0.2, apart from one very small unrelated change. InternalManagedConnectionPool.java are also the same in both versions.

      In both 3.2.6 and 4.0.2, the sub-pool being used is PoolBySubject.

      Could someone please tell me why therefore I am seeing the different behaviour between JBoss 3.2.6 and 4.0.2?

      Many Thanks,
      Bob

        • 2. Re: ManagedConnectionPool behaviour inconsistencies between
          Bob Smith Newbie

          Given the terse (and unhelpful) response, I re-read my original question to ensure there was enough information there to describe the problem, and there clearly is. So why the question is "unanswerable" escapes me, but I will post a little more detail in the hope that a useful reply is forthcoming.

          Get a connection from the DataSource *A
          Prepare a statement and get a streaming result set (RS1)
          Iterate over RS1
          {
           get a connection from the DataSource [*B - see below]
           prepare a statement and get a streaming result set (RS2)
           Iterate over RS2
           {
           *C - see below
           }
          }

          *B In JBoss 3.2.6, a different underlying connection is returned by the DataSource here than was returned at *A. In JBoss 4.0.2 the same underlying connection is returned here as it was at A* (the fact that we get the same underlying connection returned by the DataSource in JBoss 4.0.2 is the cause of the problem outlined below).

          *C When running over JBoss 4.0.2, an exception will be thrown here:
          Streaming result set com.mysql.jdbc.RowDataDynamic@c5bd66 is still active. Only one streaming result set may be open and in use per-connection. Ensure that you have called .close() on any active result sets before attempting more queries
          When running over JBoss 3.2.6, no exception will be thrown here.

          Regards,
          Bob

          • 3. Re: ManagedConnectionPool behaviour inconsistencies between
            Adrian Brock Master

             

            "bobsmith" wrote:
            So why the question is "unanswerable" escapes me.


            We could play 20 questions, but we won't.
            Instead, those questions are on that wiki page I posted.

            Just to get you started:

            What configuration files that you changed/added do you think might be relevant?
            Do you think the logging described in "READ THIS FIRST" would be useless in resolving this problem?

            • 4. Re: ManagedConnectionPool behaviour inconsistencies between
              Adrian Brock Master

              In case you are in any doubt.

              "bobsmith" wrote:

              So perhaps the code has changed between the versions - but on looking at JBossManagedConnectionPool.java, it is the same in both 3.2.6 and 4.0.2, apart from one very small unrelated change. InternalManagedConnectionPool.java are also the same in both versions.


              So if the JBoss ConnectionPool didn't change, then something else must have.
              Something else you haven't told us about. => Unanswerable question.