Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sơn Tuấn Nguyễn
Tomcat + mySql - Connection pool issue
January 16, 2013 11:37 PM
Answer

Sơn Tuấn Nguyễn

Rank: Junior Member

Posts: 37

Join Date: March 1, 2010

Recent Posts

We're running live portal 6.1 GA 1 with mySql, after a few days and user do some update database, I got this error in log:

...CommunicationsException: The last packet successfully received from the server was...

I checked db and see that they're all up to date, but liferay can't pull out the new updates, so user don't see their changes to data.
It's caused by the above error.

Getting around forum ppl say because mySql connections are closed after 8 hours, while in pool of Tomcat it runs longer, so there's a failure of communication between database and application.

First time running live liferay, I don't know how to fix it, only solution now is restart both mysql and tomcat, which is a very bad one.

Looking for advises, thanks in advance.
Mehdi norouzi
RE: Tomcat + mySql - Connection pool issue
January 17, 2013 1:47 AM
Answer

Mehdi norouzi

Rank: New Member

Posts: 19

Join Date: July 17, 2006

Recent Posts

Hi
You should balance the Max connection age and other property in both of connection pool and mysql configuration file. i mean it neads some tunning between connection pool and mysql DB. it also realy causes your performance good or bad depends on your configuration.
If you can not configure send me an email to help you in free.
Hitoshi Ozawa
RE: Tomcat + mySql - Connection pool issue
January 19, 2013 9:29 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

You haven't stated which database pool you're using. If you're just using the default c3p0, there's following properties in portal-ext.properties. You probably have to increase the timeout.

#
# The following properties will be read by C3PO if Liferay is configured to
# use C3PO in the property "jdbc.default.liferay.pool.provider". See
# http://www.mchange.com/projects/c3p0/index.html#configuration for a list
# of additional fields used by C3PO for configuring database connections.
#
jdbc.default.acquireIncrement=5
jdbc.default.acquireRetryAttempts=3
jdbc.default.acquireRetryDelay=1000
jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer
jdbc.default.idleConnectionTestPeriod=60
jdbc.default.maxIdleTime=3600
jdbc.default.maxPoolSize=100
jdbc.default.minPoolSize=10
jdbc.default.numHelperThreads=10
#jdbc.default.transactionIsolation=1

#
# The following properties will be read by both DBCP and Tomcat JDBC
# Connection Pool if Liferay is configured to use DBCP or Tomcat JDBC
# Connection Pool in the property "jdbc.default.liferay.pool.provider". See
# http://commons.apache.org/dbcp/configuration.html and
# http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html for a list of
# additional fields used by DBCP or Tomcat JDBC Connection Pool for
# configuring database connections.
#
#jdbc.default.defaultTransactionIsolation=READ_UNCOMMITTED
jdbc.default.maxActive=100
jdbc.default.minIdle=10
jdbc.default.removeAbandonedTimeout=3600