What's the best way to combine pools?

I am implementing pooling in a project. Which performance is better for this?

  • Sleep (using C3PO or DBCP)
  • Configuring a JDBC data source on the application server.

Application Server Portability is not an important factor for me. Please suggest an approach.

+2


a source to share


2 answers


Pooling is implemented in DataSource , and in both cases Hibernate will use the data source.

The question is which implementation of the data source is used and how it is configured:



  • You can specify and configure the data source directly in the hibernation configuration.
  • You can customize the data source in the application. server and specify the appropriate JNDI names in the hibernate configuration. In this case, you are using the data source implementation supplied with your application. server.

Performance wise, I think the implementation has little impact - more than whether you want yours to .war

depend on the resources managed by the application. server (case 2) or not (case 1). In case 1, C3P0 is preferred over DBCP.

+2


a source


depends on whether your application server supports federation. for example tomcat does not (as it is not a proper app server) but glassfish does. As an aside, I personally found c3po to be much better than dbcp, but it's worth checking them out as in your environment.



0


a source







All Articles