btw, i'm on jboss 4.0.3RC1. will try 4.0.4 when i get a chance later today.
do i need some special transaction stuff in the dd's? i don't think i even have a jboss-ejb-jar.xml or what ever it it is. just ejb-jar.xml for the slsb. i couldn't find info that dd stuff is needed for timedobject. i'm using xdoclet to generate the ejb-jar.xml and everything else but the implementation.
i can't seem to edit my previous posts?
anyway, i tried jboss-4.0.4CR2 i think it's working kinda like i expected. i can start a job by calling the slsb, which as i said, gets the timer service, and creates a timer. it'll be fun to see how easy it is to get 4.0.4CR2 on a production machine :).
the timer keeps running through server restarts and ejb deploys, which is good. during server restarts (and redeploys too), the timer's Info class seems to be getting reset to the initial values put into it by the slsb like so:
i have a TimedJobInfo class. This class contains two integers, a runCount, and a maxRuns. It also has a String for the jobId. It is created in the slsb's business method, and passed to the timer.
In the ejbTimeout method, the runCount is incremented and compared to the maxRuns (is there a better way to specify that the job should stop after X runs)?. runCount is initially set to 1, and i can watch it get incremented through each execution. When I redeply the ejb, the timer continues to execute, but the runCount is back to 1.
i suppose this is fine, as to me it's better to run the job more times than needed. the purpose of this job is to monitor a print job on another server by making a webservice request to get the status. if the print job has completed (success or fail) it posts xml to another server.
i'll end with some questions to hopefully get more info from the timedobject/timerservice folks.
1. should i expect 4.0.3 to persist my job through server restarts out of the box? if not can it be configured to do so?
2. is there a way to get the job's Info to re-persist it's state after each job execution.
I have similar problem.
I used 4.0.3SP1.
Now I am using jboss-4.0.4GA but the problem is not gone.
I have tried CR2, but it seems to have different EJB3 in it and my refactored_to_work_with_4.0.4GA application does not work with 4.0.4CR2.
I observe the same behaviour as it was with 4.0.3SP1: when I create the timer - new item in table 'timers' in database(I use PostgreSQL) arrive, but when server is stopped the item is removed :(
I am using stateless session bean as TimerService client.
Should I do some additional configuration or is it a bug?
There was a alink in 4.0.4GA release notes to the persistence bug and it said to be fixed but I don't think so.
I tried RC2, RC1 - no result. Timers are deleted from database on server shutdown.
About the persistence issue see http://jira.jboss.com/jira/browse/EJBTHREE-630 EJB3 need to be changed to use the new API.
About the timerInfo, as far as I remember this is only saved when the timer gets created.