構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Bruno Galvao
Connection Pool Leak on GlassFish
2012/03/02 7:04
答え

Bruno Galvao

ランク: Junior Member

投稿: 58

参加年月日: 2011/08/26

最近の投稿

I kept getting
[Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.]
so I set Leak Timeout to 300 and now I get the following error every minute. What can I do?

Log Entry Detail


Timestamp Mar 2, 2012 09:53:14.816
Log Level WARNING
Logger javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.pool
Name-Value Pairs _ThreadID=53;_ThreadName=Thread-2;
Record Number 839
Message ID
Complete Message A potential connection leak detected for connection pool LiferayPool. The stack trace of the thread is provided below : com.sun.enterprise.resource.pool.ConnectionPool.setResourceStateToBusy(ConnectionPool.java:324) com.sun.enterprise.resource.pool.ConnectionPool.getResourceFromPool(ConnectionPool.java:758) com.sun.enterprise.resource.pool.ConnectionPool.getUnenlistedResource(ConnectionPool.java:632) com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:526) com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381) com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:242) com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:167) com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338) com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301) com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190) com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165) com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160) com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113) org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:403) org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376) $Proxy111.prepareStatement(Unknown Source) sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:601) org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71) $Proxy338.prepareStatement(Unknown Source) org.quartz.impl.jdbcjobstore.StdJDBCDelegate.countMisfiredTriggersInStates(StdJDBCDelegate.java:333) org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3114) org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:3896) org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:3916) Monitoring Statistics : Monitoring Statistics for LiferayPool

Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2012/03/02 10:00
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2848

参加年月日: 2008/10/28

最近の投稿

Sorry this seems a glassfish problem. Check how is working your connection pool in admin console, and connection params.
Bruno Galvao
RE: Connection Pool Leak on GlassFish
2012/03/02 11:17
答え

Bruno Galvao

ランク: Junior Member

投稿: 58

参加年月日: 2011/08/26

最近の投稿

Turns out I think it was a network issue. Having trouble connecting to the database.
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2012/03/02 11:33
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2848

参加年月日: 2008/10/28

最近の投稿

Bruno Galvao:
Turns out I think it was a network issue. Having trouble connecting to the database.


Yep, what I meant is that this isn't a Liferay problem. What DB do you use? Can you paste here your connection pool config?
Bruno Galvao
RE: Connection Pool Leak on GlassFish
2012/03/02 12:23
答え

Bruno Galvao

ランク: Junior Member

投稿: 58

参加年月日: 2011/08/26

最近の投稿

Juan Gonzalez P:
Bruno Galvao:
Turns out I think it was a network issue. Having trouble connecting to the database.


Yep, what I meant is that this isn't a Liferay problem. What DB do you use? Can you paste here your connection pool config?



SQL Server with Connection Pool Config:






Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2012/03/02 12:21
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2848

参加年月日: 2008/10/28

最近の投稿

Guess you didn't paste properly. Image isn't available.
Bruno Galvao
RE: Connection Pool Leak on GlassFish
2012/03/02 12:24
答え

Bruno Galvao

ランク: Junior Member

投稿: 58

参加年月日: 2011/08/26

最近の投稿

Should be good now..
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2012/03/02 13:15
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2848

参加年月日: 2008/10/28

最近の投稿

Bruno Galvao:
Should be good now..


You can try changing that ConnectionPoolDataSource to simpler DataSource.

Not sure if "pooling" value has a right value (unless is the default value).

Another thing to consider, pool max connections should depend on your liferay requests. If there are many requests at the same time, perhaps this value should be increased.
Johan de jong
RE: Connection Pool Leak on GlassFish
2012/07/25 4:07
答え

Johan de jong

ランク: Junior Member

投稿: 41

参加年月日: 2012/02/06

最近の投稿

Please be aware that this is an OS related issue.

I have seen this happen with a selfmade portlet where at some moment a table with several rows needs to be updated. The update is executed as a loop that updates every single row.
On a Windows server i had no problems, but on a Solaris server (which clearly has better multitheading strategy) i ran out of connections very easy.

I saw on my Solaris server that i could have 500 connections to my database within one second. After the idle-time-out all connections are freed by Glassfish, but you must tweak this time-out to 5 seconds or so. After 5 seconds the connections drop from 500 to the set "Initial and Minimum Pool Size"