wood burning stoves 2.0*
The moose likes Servlets and the fly likes Connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Connection pooling" Watch "Connection pooling" New topic
Author

Connection pooling

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
In PHP it was easy; no bothering with connection pooling.
I wrote my scripts like I was the only one on the Internet.
But with Java and Servlets it seems to be pretty much different.
1) Do I have to worry about connection pooling at all when I implement SingleThreadModel interface???
2) Is it very very recommended to use connection pooling when SingleThreadModel interface is not used???
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
i would advise against using the SingleThreadModel.
it is mainly suited for small sites with not much traffic.
aside from that , yes copnnection pooling is the way to go in my opinion cause it is the middle ground between resources usage and clients number.
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Well why will one need to use a connection pool if u are using a singleThreadModel.As there would be seperate instances handling the request and each of those instance would by default associate itself with seperate connections.On the other way round if we do make a pool of connections and keep it to be readily picked up by the instances, once the instance dies it doesn't releases the connection but destroys all the resources used by it , so there seems to be no point in using a pool
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Is there any Connection Pool capability in mm-mysql driver, or in some other JDBC MySQL driver?
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
Originally posted by Velika Srbija:
Is there any Connection Pool capability in mm-mysql driver, or in some other JDBC MySQL driver?

Connection pooling is already implemented by most java app servers.
At least, I know tomcat and resin implements DataSource that are already pooled.
Chu
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection pooling