3 Replies Latest reply on Dec 10, 2009 8:09 AM by vickyk

    HOWTO: Pool connection management of my managed connection

    groovie

      Dear sirs,

      i have a question according to the proper
      coding of the ressource/connection
      management in JCA using the mbean
      org.jboss.resource.connectionmanager.JBossManagedConnectionPool.

      My application is using an old legacy application
      (expert system). This application has been modified
      and is running now as a classical forking-UNIX server,
      that spawns automatically a new client worker,
      if somebody tries to connect. This piece of software
      is now acting as a EIS.
      The forking model was choosen, cause to a possible
      situation, when the working is getting a SEGV-interrupt,
      the JBoss-JCA container cold establish a new connection
      with a new working.

      The connector, that has been implemented so far,
      establishes a pool of connections using the
      JBossManagedConnectionPool. The question is now,
      how to tell inside my ManagedConnection (or
      somewhere else) the controller of the
      JBossManagedConnectionPool, that the connection
      was gone and he shall create a new one.

      I think, this is the issue of the ConnectionPool-Manager,
      who will disables or remove the connection from the pool
      and try to establish a new one (using my ManagedConnection).

      Do you have some code, how to interact with the Pool ?

      The technical connection-failure is detected in my
      connection-impplementation, while reading the result of
      a previously sent request message over the TCP-connection.
      So throwing an exception is ok, but who will catch it to
      generate a message for the pool-Manager in
      org.jboss.resource.connectionmanager.JBossManagedConnectionPool
      Please-note: For RPC-request the initiating instance is a session
      bean and not the Pool-Managers!

      Thank you
      Groovie

        • 1. Re: HOWTO: Pool connection management of my managed connecti
          vickyk

           

          "groovie" wrote:
          I think, this is the issue of the ConnectionPool-Manager,
          who will disables or remove the connection from the pool
          and try to establish a new one (using my ManagedConnection)

          Yes Jboss JCA code will call the ManagedConnection's createManagedConnection(..) and matchManagedConnection() while creating the new connection from the pool and retreiving the existing connection from the Pool.
          You should refer to the code implementation of the jdbc ra here
          https://anonsvn.jboss.org/repos/jbossas/branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jdbc/

          • 2. Re: HOWTO: Pool connection management of my managed connecti
            groovie

            Salut vickyk,

            thank you for your helpful reply. In the meantime i was able to
            connect with my external legacy system. The pooling mechanism
            is working without any problem.
            From my pont of view, understanding the JCA helps to get a closer
            view to the JEE architecture. Anyway, the information is quite rare.

            Coding a JCA adapter is a bit like coding a device-driver on
            UNIX for muliple user access. So fine ...


            "vickyk" wrote:
            "groovie" wrote:
            I think, this is the issue of the ConnectionPool-Manager,
            who will disables or remove the connection from the pool
            and try to establish a new one (using my ManagedConnection)

            Yes Jboss JCA code will call the ManagedConnection's createManagedConnection(..) and matchManagedConnection() while creating the new connection from the pool and retreiving the existing connection from the Pool.


            Yes!

            Everything does work fine for me, but i noticed the invocation of the
            destroy-Methode in the connectors ManagedConnection implementation.
            From time to time, the JBoss Connection Manager is willing to kill
            a connection to the legacy systems.

            Anyway, this does not injure the connectivity, cause the connector
            does quickly perform a reconnect, but i would like to know the
            reason for behavour.

            Inside the service-XML file i noticed the following assignments
            inside the ManagedConnectionPool tag:

            5000
            15

            Are one of the both settings responsible for the destroy
            of vital connections ?

            Thank you for your support
            Christian Groove







            • 3. Re: HOWTO: Pool connection management of my managed connecti
              vickyk

              Hello Christian,

              "groovie" wrote:

              <attribute name="BlockingTimeoutMillis">5000</attribute>
              <attribute name="IdleTimeoutMinutes">15</attribute>
              Are one of the both settings responsible for the destroy
              of vital connections ?

              Yes it is the IdleTimeoutMinutes configuration which is destroying the idle connections, the idle connections are the connection in a pool which are not being used for some time.
              http://www.jboss.org/community/wiki/ConfigDataSources
              check this
              <idle-timeout-minutes> - indicates the maximum time a connection may be idle before being closed. Default is 15 minutes.


              Cheers,
              Vicky