Hello everyone, I'm with a terrible doubt here, I need to implement a connection pool with tomcat 6 + JPA without hibernate. I can use other things such as c3p0 or dbcp or any that comes out to make the pool but what I'm restricted to use is hibernate. I've searched a big part of google results but none broght me any result. I tried the tomcat pool, but tomcat cannot hold the amount of request. I'm currently making my applications in toplink + jsp, because the company doesn't let us use faces to. Is there any kind of pool that I can make to use with Toplink?
posted 5 years ago
You can use any connection pool or DataSource with TopLink, including c3po and dbcp. TopLink also supports connection pooling itself, so you could just configure a internal connection pool (this is used by default, so you really don't need to do anything, except maybe set the number of connections to be larger).
If you register you DataSource with JNDI, then you only need to set the nonJtaDataSource element in your persistence.xml. If you do not want to use JNDI, then you can use a SessionCustomizer to configure your TopLink Session's DatabaseLogin, such as using a JNDIConnector but providing the DataSource directly.