[JBoss JIRA] Created: (JBPM-1119) Timers using EjbSchedulerService are not persisted across JBoss restarts
by Aner Perez (JIRA)
Timers using EjbSchedulerService are not persisted across JBoss restarts
------------------------------------------------------------------------
Key: JBPM-1119
URL: http://jira.jboss.com/jira/browse/JBPM-1119
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.1
Environment: JBoss 4.0.5
Reporter: Aner Perez
Assigned To: Tom Baeyens
Timers created using the EjbSchedulerService do not fire if JBoss is restarted after the timer is set. The reason
is that although the JBPM timer row still exists in the database, there is no corresponding EJB timer to kick off
the JBPM timer action.
EJB timers are supposed to persist across server restarts but there is a catch. JBPM uses an EJB with a "local"
interface to dispatch the JBPM timers. JBoss (as of 4.0.2) has decided to make the jndi name of EJBs with
local interfaces have a unique name by appending an '@' sign and a hashcode to the EJB name. This hash
code is different every time the server is restarted. When the EJB timers are reloaded after a restart, the EJB
that is supposed to receive the timer doesn't exist anymore because it now has a different name (different
hashcode). This causes the timers to be deactivated and they do not fire at the appointed time.
See http://wiki.jboss.org/wiki/Wiki.jsp?page=WhyDoesTheLocalNameContainARando... for an explanation
of the EJB name issue for EJBs with a local interface.
We need a local-jndi-name parameter added to the TimerServiceBean so we can always locate it under the same name
and the timers will work as expected.
adding the following to jboss.xml takes care of this issue:
<session>
<ejb-name>TimerServiceBean</ejb-name>
<local-jndi-name>TimerServiceBean</local-jndi-name>
</session>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 11 months
[JBoss JIRA] Created: (JBPM-1092) EjbSchedulerService does not delete executed timer from DB
by Britt Miner (JIRA)
EjbSchedulerService does not delete executed timer from DB
----------------------------------------------------------
Key: JBPM-1092
URL: http://jira.jboss.com/jira/browse/JBPM-1092
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.2
Reporter: Britt Miner
Assigned To: Tom Baeyens
When using the EjbSchedulerService, I've been having a problem with non-repeating timers not being removed from the database after they are executed.
Of course, they won't be executed again because there is no longer an EJB timer to call them; however, if the EjbSchedulerService is ever replaced on the same installation with a DbSchedulerService, then all of these timers would likely be re-executed.
I was unable to find any code in the implementation that should have deleted a non-repeating timer from the database after execution, so I modified org.jbpm.scheduler.ejbtimer.ExecuteTimerCommand to take advantage of the boolean already being returned from Timer.execute():
//original line
//timer.execute(jbpmContext);
// BRITT-- if we're done with this timer, let's get rid of it...
boolean deleteJob = timer.execute(jbpmContext);
if(deleteJob) {
jbpmContext.getJobSession().deleteJob(timer);
}
// --BRITT
Note:
While I doubt that it has any effect on this issue, I'll note that to get the EjbSchedulerService working in the first place, I implemented the EJB reference changes proposed here http://jira.jboss.com/jira/browse/JBPM-836.
-Britt
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 11 months