Fórum

Two C3P0(DB) Connection Pool

M Kamran Saleem, modificado 7 Anos atrás.

Two C3P0(DB) Connection Pool

New Member Postagens: 5 Data de Entrada: 21/01/11 Postagens Recentes
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, modificado 7 Anos atrás.

RE: Two C3P0(DB) Connection Pool

Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
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, modificado 6 Anos atrás.

RE: Two C3P0(DB) Connection Pool

New Member Mensagem: 1 Data de Entrada: 04/11/14 Postagens Recentes
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