glassfish
  1. glassfish
  2. GLASSFISH-13766

lazy-connection-association : need to associate & dissociate connections appropriately

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1_b23
    • Component/s: jca
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      13,766

      Description

      Lazy connection association when trying to lazily associate a ManagedConnection
      to a connection handle, it seems not to associate a connection in
      ConnectionManager. This is a regression from v2.

      Also, the ManagedConnection of JDBC-RA need to disassociate both itself and
      physical connection from the connection holder so that cleanup is complete.
      [This is not harmful, but still it is a better approach]

      When associateConnection is called on ManagedConnection, the ManagedConnection
      is associated with the user's connection but the ManagedConnection does not seem
      to reset the reference of its user's connection to the one that is passed.

      Hence raising this issue to take care of all the three.

      1. Test.java
        5 kB
        Jagadish
      2. TestLazyAssociation.war
        4 kB
        Jagadish

        Activity

        Hide
        Jagadish added a comment -

        FIX INFORMATION :
        https://glassfish-svn.dev.java.net/servlets/ReadMsg?list=commits&msgNo=23883
        svn log -v -r 41329

        Fix will be available from Oct-3-2010 nightly / 3.1 promoted build 23

        Show
        Jagadish added a comment - FIX INFORMATION : https://glassfish-svn.dev.java.net/servlets/ReadMsg?list=commits&msgNo=23883 svn log -v -r 41329 Fix will be available from Oct-3-2010 nightly / 3.1 promoted build 23
        Hide
        Jagadish added a comment -

        Use the following configuration for jdbc/sample and DerbyPool

        <jdbc-connection-pool max-pool-size="1" is-isolation-level-guaranteed="false"
        datasource-classname="org.apache.derby.jdbc.ClientDataSource"
        res-type="javax.sql.DataSource" steady-pool-size="0" name="DerbyPool"
        idle-timeout-in-seconds="10" lazy-connection-association="true"
        lazy-connection-enlistment="true">
        <property name="PortNumber" value="1527"></property>
        <property name="Password" value="APP"></property>
        <property name="User" value="APP"></property>
        <property name="serverName" value="localhost"></property>
        <property name="DatabaseName" value="sun-appserv-samples"></property>
        <property name="connectionAttributes" value=";create=true"></property>
        </jdbc-connection-pool>
        <jdbc-resource pool-name="DerbyPool" jndi-name="jdbc/sample"></jdbc-resource>

        Show
        Jagadish added a comment - Use the following configuration for jdbc/sample and DerbyPool <jdbc-connection-pool max-pool-size="1" is-isolation-level-guaranteed="false" datasource-classname="org.apache.derby.jdbc.ClientDataSource" res-type="javax.sql.DataSource" steady-pool-size="0" name="DerbyPool" idle-timeout-in-seconds="10" lazy-connection-association="true" lazy-connection-enlistment="true"> <property name="PortNumber" value="1527"></property> <property name="Password" value="APP"></property> <property name="User" value="APP"></property> <property name="serverName" value="localhost"></property> <property name="DatabaseName" value="sun-appserv-samples"></property> <property name="connectionAttributes" value=";create=true"></property> </jdbc-connection-pool> <jdbc-resource pool-name="DerbyPool" jndi-name="jdbc/sample"></jdbc-resource>
        Hide
        Jagadish added a comment -

        Created an attachment (id=5049)
        test war

        Show
        Jagadish added a comment - Created an attachment (id=5049) test war
        Hide
        Jagadish added a comment -

        Created an attachment (id=5050)
        Test.java source

        Show
        Jagadish added a comment - Created an attachment (id=5050) Test.java source
        Hide
        Jagadish added a comment -

        Attached the modified test-case from issue 12329

        This test-case will acquire connection only once and will not close it. Further
        requests to the servlet will print that the connection is re-used and physical,
        managed connection hashcodes will be printed.

        By making the steady-pool-size=0, max-pool-size=1 and idle-timeout to 10
        seconds, within 20 seconds of idleness, connection will be recreated resulting
        in printing different hashcodes for physical and managed connection indicating
        that lazy connection association works.

        Show
        Jagadish added a comment - Attached the modified test-case from issue 12329 This test-case will acquire connection only once and will not close it. Further requests to the servlet will print that the connection is re-used and physical, managed connection hashcodes will be printed. By making the steady-pool-size=0, max-pool-size=1 and idle-timeout to 10 seconds, within 20 seconds of idleness, connection will be recreated resulting in printing different hashcodes for physical and managed connection indicating that lazy connection association works.

          People

          • Assignee:
            Jagadish
            Reporter:
            Jagadish
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: