Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.0.1 Final
-
None
-
None
Description
I have a stateless SessionBean that is also a
javax.ejb.TimedObject.
I set the timer running by calling a 'schedule'
business method
public void schedule(int mins) {
TimerService timerService = mySessionCtx.getTimerService();
// Now and every mins minutes
timerService.createTimer(0L, 60000L * mins, "iPML export timer.");
}
This methods gets called from the init method of a
Servlet.. everything works except that two timers get
created.. the second about 20 seconds after the first..
I have tracked it down to the following problem.. but
am not sure how to solve it.
1. The timer gets created and a row is written into the
localDB hypersonic database.
2. Once jboss is started (approx 20 seconds after the
init method of my servlet was called) a notification is
sent to org.jboss.ejb.txtimer.DatabasePersistencePolicy
line 102
where the method
restoreTimers();
is called
3. This method reads the row in hsqldb and creates
another duplicate txtimer
The other thing that I noticed was that the instance
variable 'instancePk' of the class
org.jboss.ejb.txtimer.TimedObjectId never gets assigned
any value.
This bug is against jboss-4.0.1RC2
Yours
Phil