Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Kan Kon
DB Connection Pool Settings
August 31, 2012 11:42 AM

Kan Kon

Rank: New Member

Posts: 23

Join Date: September 12, 2011

Recent Posts

What is the correct configuration for configuration db connection pool for 6.1? Is it ROOT.xml or portal properties file? There is a confusion because the deployment checklist document suggests to tune in ROOT.xml but already has c3p0 connection pool properties. file
 2    # The following properties will be read by C3PO if Liferay is configured to
 3    # use C3PO in the property "jdbc.default.liferay.pool.provider". See
 4    # for a list
 5    # of additional fields used by C3PO for configuring database connections.
 6    #
 7    jdbc.default.acquireIncrement=5
 8    jdbc.default.acquireRetryAttempts=3
 9    jdbc.default.acquireRetryDelay=1000
10    jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer
11    jdbc.default.idleConnectionTestPeriod=60
12    jdbc.default.maxIdleTime=3600
13    jdbc.default.maxPoolSize=100
14    jdbc.default.minPoolSize=10
15    jdbc.default.numHelperThreads=10
16    #jdbc.default.transactionIsolation=1


 3description=”Portal DB Connection”
 6 minPoolSize=”10”
13jdbcUrl=”jdbc:mysql://someServer:3306/lportal?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateP arsing=false”/>

What is the correct configuration?
David H Nebinger
RE: DB Connection Pool Settings
August 31, 2012 11:55 AM

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 13222

Join Date: September 1, 2006

Recent Posts

Depends on whether you're using a JNDI data source lookup or a direct JDBC connection.

If the JNDI approach, the ROOT.xml contains the resource definition for the datasource and the c3p0 tweaking goes here.

For the JDBC connection, ROOT.xml will not have the resource definition and you'll define your properties in the, and the c3p0 tweaking goes here.

It's really a choice whether you want the database connection managed at the application container level or at the Liferay level. Ideally if it is at the application container level, the connection pool can be shared by other web applications (only if you move the resource from the ROOT.xml to the global server.xml file).

Otherwise it makes little difference which way you go.
Mika Koivisto
RE: DB Connection Pool Settings
August 31, 2012 3:41 PM

Mika Koivisto

Rank: Liferay Legend

Posts: 1518

Join Date: August 7, 2006

Recent Posts

Like David said you can either use JNDI datasource or let Liferay create the datasource. I personally prefer the JNDI datasource approach. I recently blogged about configuring c3p0 connection pool for Liferay on Tomcat.
Hitoshi Ozawa
RE: DB Connection Pool Settings
September 1, 2012 4:15 AM

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If you're using 6.1, the first time you start liferay, setup page should be displayed where you can specify jdbc connection. Settings specified here is saved in the It's probably better to specify connection pool in (note, not in in this circumstance.

Liferay documents are sometimes confusing because there are different ways to do the same thing in liferay.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!