Forums de discussion

Two C3P0(DB) Connection Pool

M Kamran Saleem, modifié il y a 7 années.

Two C3P0(DB) Connection Pool

New Member Publications: 5 Date d'inscription: 21/01/11 Publications récentes
Hello Everyone,

It has been observed that Liferay creates Two (C3P0) Pools by default. Any idea why Two pools are required or being used by Liferay?
Only ROOT application is deployed in my Tomcat/webapps. (No other application or Portlet) and using default C3P0 properties.

See an attached video of JConsole/MBeans.

Regards,
Kamran
thumbnail
Mika Koivisto, modifié il y a 7 années.

RE: Two C3P0(DB) Connection Pool

Liferay Legend Publications: 1519 Date d'inscription: 07/08/06 Publications récentes
Liferay creates two datasources if you let it auto create them and you are not using existing connection pool from JNDI. Liferay creates another datasource for counter service to prevent deadlocks but I've never had any issues having just one that is configured as JNDI resource. I've blogged about how to configure c3p0 connection pool as JNDI resource in Tomcat.
Michael Chen, modifié il y a 6 années.

RE: Two C3P0(DB) Connection Pool

New Member Envoyer: 1 Date d'inscription: 04/11/14 Publications récentes
This 2014 blog (Approach 2: JNDI) is a better choice. You only need to modify one file: TOMCAT/conf/context.xml.

https://web.liferay.com/web/pmesotten/blog/-/blogs/database-connection-pool-sharing-between-portal-and-portlets