users@glassfish.java.net

EJB Timer service & Database failure

From: <glassfish_at_javadesktop.org>
Date: Fri, 12 Feb 2010 16:10:32 PST

I'm running Glassfish 2.1b60e.

I have a timer executing every 30 seconds in a clustered configuration, only 1 server is active in the cluster at this time. If the database with the timer database is shut down while a timer is supposed to be executed the timer is never executed even after the database is brought back online.

Calls to the resource timerservice.getTimeRemaining() keep updating and going from 30 seconds to 0 but when it hits zero nothing happens. Only removing and recreating the timer seems to make the timer execute again.

I attempted to change the redelivery limit in the EJB Timer configuration but that had no affect. The following is the error i get in the server logs, which I expect, but I would have expected that sometime after the the database comes back online the timers would have restarted.








[#|2010-02-12T23:43:16.672+0000|WARNING|sun-appserver2.1|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=45;_ThreadName=p: thread-pool-1; w: 49;_RequestID=ad65fe75-a15f-4b07-85e8-a3c8e1b04bc9;|JDO74004: Bean 'TimerBean' method ejbFindByPrimaryKey:
com.sun.jdo.api.persistence.support.JDODataStoreException: JDO77006: SQL exception: state = null, error code = 0.
NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure

Last packet sent to the server was 0 ms ago.
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1465)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1358)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:447)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:376)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.retrieve(SQLStateManager.java:2059)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1197)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1153)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:658)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:276)
        at com.sun.ejb.containers.TimerBean_2100919770_ConcreteImpl.ejbFindByPrimaryKey(TimerBean_2100919770_ConcreteImpl.java:1066)
        at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
        at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
        at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:803)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:233)
        at $Proxy12.findByPrimaryKey(Unknown Source)
        at com.sun.ejb.containers.EJBTimerService.findTimer(EJBTimerService.java:1180)
        at com.sun.ejb.containers.EJBTimerService.removeTimerBean(EJBTimerService.java:1278)
        at com.sun.ejb.containers.EJBTimerService.expungeTimer(EJBTimerService.java:982)
        at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1470)
        at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:99)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1952)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.service(EJBTimerService.java:1948)
        at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)

NestedStackTrace:
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure

Last packet sent to the server was 0 ms ago.
        at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
        at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl.getConnection(TransactionHelperImpl.java:212 )
        at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnection(EJBHelper.java:197)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1447)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1358)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:447)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:376)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.retrieve(SQLStateManager.java:2059)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1197)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1153)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:658)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:276)
        at com.sun.ejb.containers.TimerBean_2100919770_ConcreteImpl.ejbFindByPrimaryKey(TimerBean_2100919770_ConcreteImpl.java:1066)
        at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
        at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
        at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:803)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:233)
        at $Proxy12.findByPrimaryKey(Unknown Source)
        at com.sun.ejb.containers.EJBTimerService.findTimer(EJBTimerService.java:1180)
        at com.sun.ejb.containers.EJBTimerService.removeTimerBean(EJBTimerService.java:1278)
        at com.sun.ejb.containers.EJBTimerService.expungeTimer(EJBTimerService.java:982)
        at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1470)
        at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:99)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1952)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.service(EJBTimerService.java:1948)
        at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
|#]

[#|2010-02-12T23:43:16.680+0000|INFO|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=45;_ThreadName=p: thread-pool-1; w: 49;TimerBean;|EJB5018: An exception was thrown during an ejb invocation on [TimerBean]|#]

[#|2010-02-12T23:43:16.681+0000|INFO|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=45;_ThreadName=p: thread-pool-1; w: 49;|
javax.ejb.EJBException
        at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3894)
        at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3794)
        at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3596)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1379)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:251)
        at $Proxy12.findByPrimaryKey(Unknown Source)
        at com.sun.ejb.containers.EJBTimerService.findTimer(EJBTimerService.java:1180)
        at com.sun.ejb.containers.EJBTimerService.removeTimerBean(EJBTimerService.java:1278)
        at com.sun.ejb.containers.EJBTimerService.expungeTimer(EJBTimerService.java:982)
        at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1470)
        at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:99)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1952)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.service(EJBTimerService.java:1948)
        at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: com.sun.jdo.api.persistence.support.JDODataStoreException: JDO77006: SQL exception: state = null, error code = 0.
NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure

Last packet sent to the server was 0 ms ago.
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1465)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1358)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:447)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:376)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.retrieve(SQLStateManager.java:2059)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1197)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1153)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:658)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:276)
        at com.sun.ejb.containers.TimerBean_2100919770_ConcreteImpl.ejbFindByPrimaryKey(TimerBean_2100919770_ConcreteImpl.java:1066)
        at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
        at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
        at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:803)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:233)
        ... 10 more
|#]

[#|2010-02-12T23:43:16.684+0000|WARNING|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=45;_ThreadName=p: thread-pool-1; w: 49;6@@1266011927089@@server0@@server0;_RequestID=ad65fe75-a15f-4b07-85e8-a3c8e1b04bc9;|EJB5118:Failure removi ng timer bean [6@@1266011927089@@server0@@server0]|#]

[#|2010-02-12T23:43:16.685+0000|WARNING|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=45;_ThreadName=p: thread-pool-1; w: 49;_RequestID=ad65fe75-a15f-4b07-85e8-a3c8e1b04bc9;|
javax.ejb.EJBException
        at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3894)
        at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3794)
        at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3596)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1379)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:251)
        at $Proxy12.findByPrimaryKey(Unknown Source)
        at com.sun.ejb.containers.EJBTimerService.findTimer(EJBTimerService.java:1180)
        at com.sun.ejb.containers.EJBTimerService.removeTimerBean(EJBTimerService.java:1278)
        at com.sun.ejb.containers.EJBTimerService.expungeTimer(EJBTimerService.java:982)
        at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1470)
        at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:99)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1952)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.service(EJBTimerService.java:1948)
        at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: com.sun.jdo.api.persistence.support.JDODataStoreException: JDO77006: SQL exception: state = null, error code = 0.
NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure

Last packet sent to the server was 0 ms ago.
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1465)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1358)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:447)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:376)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.retrieve(SQLStateManager.java:2059)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1197)
        at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1153)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:658)
        at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:276)
        at com.sun.ejb.containers.TimerBean_2100919770_ConcreteImpl.ejbFindByPrimaryKey(TimerBean_2100919770_ConcreteImpl.java:1066)
        at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
        at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
        at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:803)
        at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:233)
        ... 10 more
|#]
[Message sent by forum member 'sol1001' (jon_at_vadney.net)]

http://forums.java.net/jive/thread.jspa?messageID=386481