Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Bruno Galvao
Connection Pool Leak on GlassFish
2 de Março de 2012 07:04
Resposta

Bruno Galvao

Ranking: Junior Member

Mensagens: 58

Data de entrada: 26 de Agosto de 2011

Mensagens recentes

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
2 de Março de 2012 10:00
Resposta

Juan Gonzalez

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1865

Data de entrada: 28 de Outubro de 2008

Mensagens recentes

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
2 de Março de 2012 11:17
Resposta

Bruno Galvao

Ranking: Junior Member

Mensagens: 58

Data de entrada: 26 de Agosto de 2011

Mensagens recentes

Turns out I think it was a network issue. Having trouble connecting to the database.
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2 de Março de 2012 11:33
Resposta

Juan Gonzalez

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1865

Data de entrada: 28 de Outubro de 2008

Mensagens recentes

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
2 de Março de 2012 12:23
Resposta

Bruno Galvao

Ranking: Junior Member

Mensagens: 58

Data de entrada: 26 de Agosto de 2011

Mensagens recentes

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
2 de Março de 2012 12:21
Resposta

Juan Gonzalez

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1865

Data de entrada: 28 de Outubro de 2008

Mensagens recentes

Guess you didn't paste properly. Image isn't available.
Bruno Galvao
RE: Connection Pool Leak on GlassFish
2 de Março de 2012 12:24
Resposta

Bruno Galvao

Ranking: Junior Member

Mensagens: 58

Data de entrada: 26 de Agosto de 2011

Mensagens recentes

Should be good now..
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2 de Março de 2012 13:15
Resposta

Juan Gonzalez

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1865

Data de entrada: 28 de Outubro de 2008

Mensagens recentes

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
25 de Julho de 2012 04:07
Resposta

Johan de jong

Ranking: Junior Member

Mensagens: 35

Data de entrada: 6 de Fevereiro de 2012

Mensagens recentes

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"