9 Replies Latest reply on Oct 17, 2007 10:39 AM by liu jw

    How to configure the minsize and maxsize of connectionpool i

    liu jw Newbie

      Hello:
      I want to configure MannagedConnectionPool num of my jca, but I don't know who to configure it. The follows is my configure files in jboss:

      <!DOCTYPE connection-factories PUBLIC
       "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
      <!--
       The non-transaction FileSystem resource adaptor service configuration
      -->
      <connection-factories>
       <no-tx-connection-factory>
       <jndi-name>NoTransFile</jndi-name>
       <rar-name>j2eepro.ear#j2eepro.rar</rar-name>
       <connection-definition>
       javax.resource.cci.ConnectionFactory
       </connection-definition>
       </no-tx-connection-factory>
      </connection-factories>


      Can someone help me? Thanks!

        • 2. Re: How to configure the minsize and maxsize of connectionpo
          liu jw Newbie

          Thank you for you reply.
          Because I write an simple JCA without JDBC.
          I refered the example of "Example 7.2" in http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html#ch7.genericjca.sect
          I'm sorry that I don't know how to use "min-pool-size AND max-pool-size tags" in this station.

          • 3. Re: How to configure the minsize and maxsize of connectionpo
            Vicky Kak Master

             

            "liujw2001" wrote:

            I'm sorry that I don't know how to use "min-pool-size AND max-pool-size tags" in this station.

            Here it goes
            <!DOCTYPE connection-factories PUBLIC
             "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
             "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
            <!--
             The non-transaction FileSystem resource adaptor service configuration
            -->
            <connection-factories>
             <no-tx-connection-factory>
             <jndi-name>NoTransFile</jndi-name>
             <min-pool-size>[PUT HERE THE MINIMUM POOL SIZE]</min-pool-size>
             <max-pool-size>[PUT HERE THE MAXIMUM POOL SIZE]</max-pool-size>
             <rar-name>j2eepro.ear#j2eepro.rar</rar-name>
             <connection-definition>
             javax.resource.cci.ConnectionFactory
             </connection-definition>
             </no-tx-connection-factory>
            </connection-factories>


            • 4. Re: How to configure the minsize and maxsize of connectionpo
              liu jw Newbie

              Thank you!
              I want to ask for another question.
              I once saw an article say that if you appoint the minsize of ManagedConnectionPool for "n", there will create "n" num of ManagedConnections for ManagedConnectionPool ahead while jboss is deploying.

              But I find it is not ture when I debug it while starting the jboss.

              Is that ture?

              • 5. Re: How to configure the minsize and maxsize of connectionpo
                liu jw Newbie

                Another:
                How can I see the num of instance in MannagedConnectionPool?

                • 6. Re: How to configure the minsize and maxsize of connectionpo
                  Vicky Kak Master

                   

                  "liujw2001" wrote:

                  I once saw an article say that if you appoint the minsize of ManagedConnectionPool for "n", there will create "n" num of ManagedConnections for ManagedConnectionPool

                  This is possible if prefill tag is set true ...
                  Have a look at this link
                  http://jira.jboss.com/jira/browse/JBAS-1466

                  You can view the pool related information from the jmx-console , look at the ManagedConnectionPool MBean .
                  Search for the MBean with the domain name as jboss.jca:* in jmx console , one of the MBean would be ManagedConnectionPool MBean ..



                  • 7. Re: How to configure the minsize and maxsize of connectionpo
                    liu jw Newbie

                    Thank you for your help.

                    I have another question. If a ManagedConnection is used by connection, Can this ManagedConnection be matched with a new connecion?

                    If so, I have the following question:

                    If one connection "A" get a ManagedConnection from pool which is used by another connection "B". After the first one "A" finished and want to close, dose it have some effection to connection "B"? for example, if "A" invokes "close()", the ManagedConnection will invoke the "cleanup()" function, does it effect the connection "B"? Is the ManagedConnection pushed into pool before the "A" finished ?

                    The second question is why jobss service does't invoke "mathManagedConnection()" which is implemented in MyManagecConnectionFactory?

                    • 8. Re: How to configure the minsize and maxsize of connectionpo
                      Adrian Brock Master

                       

                      "liujw2001" wrote:
                      Thank you for your help.

                      I have another question. If a ManagedConnection is used by connection, Can this ManagedConnection be matched with a new connecion?


                      PLEASE CREATE ONE THREAD PER QUESTION.
                      Multiple questions on one thread makes it very difficult to follow,
                      both for those answering the questions and those searching for answers
                      to similar questions later.


                      If so, I have the following question:

                      If one connection "A" get a ManagedConnection from pool which is used by another connection "B". After the first one "A" finished and want to close, dose it have some effection to connection "B"? for example, if "A" invokes "close()", the ManagedConnection will invoke the "cleanup()" function, does it effect the connection "B"? Is the ManagedConnection pushed into pool before the "A" finished ?


                      The connection does not "get" a ManagedConnection.

                      The ConnectionManager retrieves a "connection handle" for a ManagedConnection
                      to give to the user application.

                      Whether there are mutliple connection handles
                      for a ManagedConnection depends upon the ConnectionManager configuration
                      (e.g. transaction affinity or interleaving - not relevant in your case)
                      and what the application is doing
                      (e.g. opening multiple connections handles in the same transaction)

                      Regardless, the ManagedConnection won't be returned to the pool until ALL
                      connection handles associated with it are closed by the application(s)
                      (and in the case of transaction affinity until the transaction ends).

                      THIS IS ANSWERED IN THE SPEC. See the javaee connector architecture 1.5 spec available from www.jcp.org

                      If you think the spec is unclear, speak to the author(s). :-)
                      There will be an e-mail address associated with the spec where you can post comments.


                      The second question is why jobss service does't invoke "mat{c}hManagedConnection{s}()" which is implemented in MyManagecConnectionFactory?


                      THIS IS ALSO SPEC DEFINED BEHAVIOUR, see the section on pooling.


                      • 9. Re: How to configure the minsize and maxsize of connectionpo
                        liu jw Newbie


                        Thank you very much!

                        PLEASE CREATE ONE THREAD PER QUESTION.


                        I will be careful next time. :-)

                        Gook luck!