Lenin is correct.

With my experience, I can say that to write a good quality connection pool
is not easy jobb.
Particularly 
* Else wait for a resource to be released from one of the threads ( this is
tricky, say there's a DB resource leak and all the resources in the pool are
leaks, then you'll run into a freeze. Your waiting thread will have to wait
indefinitely for a DB resource to be released while they are actually leaks
)
needs to be done carefully.

Because any issues in the connection pool will not be reflected immedatly
unless the pool is tested against the expected loads and concurrency.

This problem will be reflected as there will be more concurrent users to
your application. The application may itself hang OR the database may
escalate its lock levels.

I suggest that you refer to some already implemented freely available
connection pools(I think there is one from Orielly) and then make your
changes on the top of that.

Regards,
Chandrashekhar.

-----Original Message-----
From: Lenin Lakshminarayanan -X (lelakshm - HCL at Cisco)
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 05, 2006 11:45 PM
To: Tomcat Users List
Subject: RE: need inputs on connection pool

You'll have to release the connection to the pool and _NOT_ close the
connection. It's something like this :

        * Create a resource pool that maintains the pool
        * release the resource from the pool upon request ( if the resource
Is already there in the pool and can be utilized )
        * Else create a resource ( if the resource pool limit is not reached
) upon request and once the resource is used, _RELEASE_ it to the pool and
_NOT_CLOSE_ the connection.
        * Else wait for a resource to be released from one of the threads (
this is tricky, say there's a DB resource leak and all the resources in the
pool are leaks, then you'll run into a freeze. Your waiting thread will have
to wait indefinitely for a DB resource to be released while they are
actually leaks )

Hope this helps.
Lenin

-----Original Message-----
From: Abh N [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 05, 2006 8:16 AM
To: users@tomcat.apache.org
Subject: need inputs on connection pool

Hi,
   
  we are implementing the connection pooling in our application.
   
  connections are taken from the data source. 
   
  After getting the connection i need to confirm whether i have to explictly
close the connection
   like conn.close ()
   
  i want to know in above case whether connection will be release to the
pool or will get closed.
   
  i have a doubt as in above case the connection might be getting closed and
might not be available for re-use.

   

                                
---------------------------------
 Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to