Logging Mechanism for Liferay Database Pool

Issue

1. How to increase the logging around connection pool which can help to understand the activities within the connection pool?
2. What other container-managed database connection pool can be used instead of c3p0?

Environment

  • Liferay 6.2

Resolution

1. How to increase the logging around connection pool which can help to understand the activities within the connection pool?

Ans: Below steps can be followed to increase the logs for the connection pool.
a) Go to Control > Configuration > Server Administration
b) Under Server Administration, go to Log Level.
c) Search for "com.liferay.portal.dao.jdbc.pool". Increase the log level for the connection pool as per your business requirement. 

2. What other container-managed database connection pool can be used instead of c3p0?

Ans:  Other then c3po, dbcp, and tomcat can be used, by default c3p0 is used. Following property in the portal-ext.properties can be used to use the other provider.

# Liferay can use C3PO, DBCP, or Tomcat for connection pooling. See
    # com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean for the actual
    # implementation. It is important to understand the strengths and weaknesses
    # of each provider so that you can choose the best one that fits your
    # deployment scenario. Provider specific properties can also be passed along
    # directly to the provider. For example, the property
    # "jdbc.default.acquireIncrement" is read by C3PO, and the property
    # "jdbc.default.maxActive" is read by DBCP.
    #
    # The default provider is C3PO.
    #
    jdbc.default.liferay.pool.provider=c3po
    #jdbc.default.liferay.pool.provider=dbcp
    #jdbc.default.liferay.pool.provider=tomcat
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助