You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jeffery Painter <pa...@kiasoft.com> on 2003/01/22 20:35:02 UTC

scheduler answers

I think I've craced scheduler! :)

I just needed to remember that job acts like a peer class

the idBroker need to get a wake up call to assign an id to the job.

so...

 in my Scheduler action when I create the new JobEntry, after creating the 
 job do:

  job.setNew(true); 	// tells id broker to reserve a new key
  job.save();	    	// make object persistent to TURBINE_SCHEDULED_JOB

this will force it into the db.

also, if you do want to access the id from velocity, use 

 $job.primaryKey

this worked for me. if the job is not persistent, then obviously it will 
have a primaryKey of null.

so scheduler does work in tdk-2.1! :) just needed some more info. I hope 
this is of use to anyone else who might be trying to still work with 2.1

the migration to 2.2 still looks a little scary to me. when I have more 
time I'll give it a try.


thanks all,
Jeff Painter


On Wed, 22 Jan 2003, Jeffery Painter wrote:

> that was it exactly. it was running every 45 minutes. also to note, if you 
> setup a job in this manner, it takes the time of entry as the starting 
> time and will then run every x minutes after you put it in.
> 
> what I should have input was 0,60,-1,-1,-1 -- that would make it run once 
> an hour
> 
> I will try the job.save() and also try setting count to static.
> 
> maybe I can update the scheduler how-to with my finds once complete.
> 
> thanks
> 
> On Wed, 22 Jan 2003, Wei He wrote:
> 
> > 
> > In the scheduled jon class, the task count should be declared static so 
> > it does not get reset each time the job is run.
> > 
> > If you want to save the job into database, call job.save() after it is set.
> > 
> > 
> > As for the the timing issue, I believe it is doing every number of 
> > minutes, or seconds starting from the time it starts.
> > 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>