掲示板

Connection Pool Leak on GlassFish

thumbnail
12年前 に Bruno Galvao によって更新されました。

Connection Pool Leak on GlassFish

Junior Member 投稿: 58 参加年月日: 11/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

thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Connection Pool Leak on GlassFish

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Sorry this seems a glassfish problem. Check how is working your connection pool in admin console, and connection params.
thumbnail
12年前 に Bruno Galvao によって更新されました。

RE: Connection Pool Leak on GlassFish

Junior Member 投稿: 58 参加年月日: 11/08/26 最新の投稿
Turns out I think it was a network issue. Having trouble connecting to the database.
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Connection Pool Leak on GlassFish

Liferay Legend 投稿: 3089 参加年月日: 08/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?
thumbnail
12年前 に Bruno Galvao によって更新されました。

RE: Connection Pool Leak on GlassFish

Junior Member 投稿: 58 参加年月日: 11/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:






thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Connection Pool Leak on GlassFish

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Guess you didn't paste properly. Image isn't available.
thumbnail
12年前 に Bruno Galvao によって更新されました。

RE: Connection Pool Leak on GlassFish

Junior Member 投稿: 58 参加年月日: 11/08/26 最新の投稿
Should be good now..
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Connection Pool Leak on GlassFish

Liferay Legend 投稿: 3089 参加年月日: 08/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.
11年前 に Johan de jong によって更新されました。

RE: Connection Pool Leak on GlassFish

Junior Member 投稿: 41 参加年月日: 12/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"