Give me an explanation : Commons DBCP !
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sherbir_S
Posted On:   Wednesday, September 29, 2004 01:42 AM

Hi all experts, I am using the Tomcat server to deploy my web application. My web application accesses the MySQL database on the server. I faced the problem of "Too many Connections" and went through a few websites regarding the error. Finally, I found the solution and successfully implemented the Commons DBCP. Now I want to know a few things : DBCP creates a pool of connections. Connections r served on demand from this pool. But still, in the code that I use in my JSP/Servlet, I have to explicitly close the connection....con.close(). Is it necessary to do that ? What possible errors could I get if I don't do that ? Could any1 ple   More>>
			

Hi all experts,

I am using the Tomcat server to deploy my web application. My web application accesses the MySQL database on the server.

I faced the problem of "Too many Connections" and went through a few websites regarding the error.

Finally, I found the solution and successfully implemented the Commons DBCP.

Now I want to know a few things :

DBCP creates a pool of connections. Connections r served on demand from this pool.

But still, in the code that I use in my JSP/Servlet, I have to explicitly close the connection....con.close().

Is it necessary to do that ?

What possible errors could I get if I don't do that ?

Could any1 please elaborate ?

Thanx and Regards
Sherbir

   <<Less

Re: Give me an explanation : Commons DBCP !

Posted By:   Ivo_Limmen  
Posted On:   Wednesday, September 29, 2004 03:08 AM

If you close a connection it is not physically closed but put back in the pool for further use.
Yes it is necessary to do this or else you get errors from DBCP that there are no connections left for the application to use.
About | Sitemap | Contact