Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Bruno Galvao
Connection Pool Leak on GlassFish
2 marzo 2012 7.04
Risposta

Bruno Galvao

Punteggio: Junior Member

Messaggi: 58

Data di Iscrizione: 26 agosto 2011

Messaggi recenti

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 marzo 2012 10.00
Risposta

Juan Gonzalez

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2892

Data di Iscrizione: 28 ottobre 2008

Messaggi recenti

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 marzo 2012 11.17
Risposta

Bruno Galvao

Punteggio: Junior Member

Messaggi: 58

Data di Iscrizione: 26 agosto 2011

Messaggi recenti

Turns out I think it was a network issue. Having trouble connecting to the database.
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2 marzo 2012 11.33
Risposta

Juan Gonzalez

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2892

Data di Iscrizione: 28 ottobre 2008

Messaggi recenti

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 marzo 2012 12.23
Risposta

Bruno Galvao

Punteggio: Junior Member

Messaggi: 58

Data di Iscrizione: 26 agosto 2011

Messaggi recenti

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 marzo 2012 12.21
Risposta

Juan Gonzalez

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2892

Data di Iscrizione: 28 ottobre 2008

Messaggi recenti

Guess you didn't paste properly. Image isn't available.
Bruno Galvao
RE: Connection Pool Leak on GlassFish
2 marzo 2012 12.24
Risposta

Bruno Galvao

Punteggio: Junior Member

Messaggi: 58

Data di Iscrizione: 26 agosto 2011

Messaggi recenti

Should be good now..
Juan Gonzalez
RE: Connection Pool Leak on GlassFish
2 marzo 2012 13.15
Risposta

Juan Gonzalez

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2892

Data di Iscrizione: 28 ottobre 2008

Messaggi recenti

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 luglio 2012 4.07
Risposta

Johan de jong

Punteggio: Junior Member

Messaggi: 41

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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"