tags:

views:

598

answers:

2

I have J2EE Application where I am using JPA/Toplink now I want to implement external or internal connection pool ... please help me to figure out how to implement connection pooling with JPA/TopLink ...

+2  A: 

Well you shouldn't implement a connection pool yourself.

If your app is running inside an app server (JBoss, Glassfish..) your JPA code will use the connection pools that are configured by the app server. If you are running standalone you can use any of the number of existing open source connection pool implementations such as DBCP.

Gregory Mostizky
I am using tomcat 6.0. is there any way still i can get connection pool ?
Bihag Raval
This link explains how: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html It uses DBCP internally
Gregory Mostizky
A: 

I agree with Gregory, you don't want to write a connection pool yourself. Have a look at e.g. Proxool or Commons DBCP which are both well-tested opensource connection pools.

Proxool, in my opinion, has the advantage of being trivial to add to an existing project.

fvu