Foren

Two C3P0(DB) Connection Pool

M Kamran Saleem, geändert vor 7 Jahren.

Two C3P0(DB) Connection Pool

New Member Beiträge: 5 Beitrittsdatum: 21.01.11 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Two C3P0(DB) Connection Pool

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
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, geändert vor 6 Jahren.

RE: Two C3P0(DB) Connection Pool

New Member Beitrag: 1 Beitrittsdatum: 04.11.14 Neueste Beiträge
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