4 Replies Latest reply on Dec 3, 2012 6:19 PM by Vítor Corrêa

    Problem while closing connection (wrappedConnection) retrieved from JBoss 5 pool.

    ayushgupta Newbie

      I have been using xa-datasource to have a connection pool for underlying oracle 10g database. I have created a pool of min size : 20 and max size : 40. I have a scenario where 20 threads are active, and each threads takes connection from the pool, completes its DB operation (i.e. saves approx 4000 records to DB). Once it completes the execution, it closes the connection which ideally should go back to the connection pool. The execution thread repeats  it execution by taking a connection from pool and closes at the end on each execution cycle.


              <xa-datasource-property name="URL">jdbc:oracle:thin:@smm_db_host:1521/ALSMM</xa-datasource-property>
              <xa-datasource-property name="User">EPB_APP_CONF</xa-datasource-property>
          <xa-datasource-property name="Password">abc123</xa-datasource-property>
              <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
              <!--pooling parameters-->

      Now as connection is closed, it should go back to the pool immediately, but what I have been observing from the admin console, that max connection count goes upto 28. It is sure that no other process is running into the system apart from these 20 threads. Each thread retrieves the connection from pool and closes it.


      I just want to know, what could be the reason for going a max count upto 28, which should ideally be 20.


      Does close method invocation, just returns the handler, and in back-ground it actually takes time to synchronize the data with uderlying DB. I just want to restrict that the haldler should be returned only once the connection actually is returned back to pool.