Fórum

Weird database connection behavior

Kristof Verbraeken, modificado 11 Anos atrás.

Weird database connection behavior

Junior Member Postagens: 54 Data de Entrada: 25/02/09 Postagens Recentes
Hello everyone,

I'm using a Liferay 5.2.3 CE JBoss 4.2.1 bundle in combination with a DB2 9.7 database in production.

I experienced some weird database connection problems a few weeks ago, but I solved these by configuring the database connection through a datasource instead of using the database configuration in portal-ext.properties.

However in the past few days I'm experiencing a new problem at just random moments:

2012-08-23 22:11:14,507 ERROR [org.hibernate.util.JDBCExceptionReporter] You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.; – nested throwable: (javax.resource.ResourceException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)

Can someone explain this error some more to me or does anyone know a solution for this?

Thanks in advance for any tips!

Kind regards,
Kristof
Kristof Verbraeken, modificado 11 Anos atrás.

RE: Weird database connection behavior

Junior Member Postagens: 54 Data de Entrada: 25/02/09 Postagens Recentes
I attached a screenshot showing the behavior of the garbage collector during those problematic moments.

Does this look like normal behavior?
Amine Bousta, modificado 11 Anos atrás.

RE: Weird database connection behavior

New Member Postagens: 4 Data de Entrada: 10/08/12 Postagens Recentes
Hi

May be you're facing a JBoss datasource management issue rather than a Liferay issue ?

You may build up a new simple jsp project in another context and test your datasource management with it.
Try to automate select and update Hibernate queries with it in a long period and you will probably rise up the same error.
If you can reproduce this error like this you will be sure it is not a Liferay issue. Then you'll be much closer to the solution.
(did you check if there is any update of your jdbc driver?)
I don't think it is related to the garbage collector behavior.

I might be wrong but it worthes the test because it can isolate the problem in a degraded context and ease your debug work.

Cheers
Kristof Verbraeken, modificado 11 Anos atrás.

RE: Weird database connection behavior

Junior Member Postagens: 54 Data de Entrada: 25/02/09 Postagens Recentes
Things went great for about two weeks since I started using a datasource configuration instead of portal.properties database configuration.

However, during this weekend a new problem occured. Does anybody have any idea about this error?

Thanks in advance!

2012-09-09 04:16:18,588 ERROR [org.quartz.core.ErrorLogger] An error occured while scanning for the next trigger to fire.
org.quartz.JobPersistenceException: Couldn't rollback jdbc connection. [ibm][db2][jcc][10335][10366] Invalid operation: Connection is closed. [See nested exception: com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10335][10366] Invalid operation: Connection is closed.]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2319)
at org.quartz.impl.jdbcjobstore.JobStoreTX.acquireNextTrigger(JobStoreTX.java:1222)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233)
* Nested Exception (Underlying Cause) ---------------
com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10335][10366] Invalid operation: Connection is closed.
at com.ibm.db2.jcc.c.p.Mb(p.java:3153)
at com.ibm.db2.jcc.c.p.p(p.java:768)
at com.ibm.db2.jcc.c.p.rollback(p.java:754)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:581)
at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:364)
at $Proxy53.rollback(Unknown Source)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:2317)
at org.quartz.impl.jdbcjobstore.JobStoreTX.acquireNextTrigger(JobStoreTX.java:1222)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:233)
thumbnail
Hitesh Methani, modificado 11 Anos atrás.

RE: Weird database connection behavior

Regular Member Postagens: 171 Data de Entrada: 24/06/10 Postagens Recentes
Hi Kristof,

Seems connection of database is closed before application closes the idle connection.
Please verify if database connection time out is set higher(or atleast equal but not less) than connnection time out at application(liferay) level.

Thanks and Regards,
Hitesh Methani.