[jboss-user] [Installation, Configuration & DEPLOYMENT] - schedulable job blocks other schedulable jobs

skymic do-not-reply at jboss.com
Tue Apr 1 09:48:48 EDT 2008


I am running a JBoss V4.0.5 GA cluster on a LINUX platform.

I have two schedulable jobs. The configuration in scheduler-service.xml is as follows:

 	<mbean code="org.jboss.varia.scheduler.Scheduler" name="ch.skyguide.aim.schedulable:service=ISUPAgentProxy">
  | 		<attribute name="StartAtStartup">true</attribute>
  | 		<attribute name="SchedulableClass">ch.skyguide.aim.schedulable.agent.isup.ISUPAgentProxy</attribute>
  | 		<attribute name="SchedulableArguments">localhost,8080,localhost,8080</attribute>
  | 		<attribute name="SchedulableArgumentTypes">java.lang.String,java.lang.String,java.lang.String,java.lang.String</attribute>
  | 		<attribute name="InitialStartDate">NOW</attribute>
  | 		<attribute name="SchedulePeriod">60000</attribute>
  | 		<attribute name="InitialRepetitions">-1</attribute>
  | 		<attribute name="FixedRate">true</attribute>
  | 	</mbean>
  |     <mbean code="org.jboss.varia.scheduler.Scheduler" name="ch.skyguide.aim.schedulable:service=ImportNavDataProxy">
  |         <attribute name="StartAtStartup">true</attribute>
  |         <attribute name="SchedulableClass">ch.skyguide.aim.schedulable.agent.importnavdata.ImportNavDataProxy</attribute>
  |         <attribute name="SchedulableArguments">c:/NavDataUpload,c:/NavDataUploadTmp,${jboss.server.log.dir},jnp://zhwtdeibeckml:1099/SDOCIImportApp/ImportNavDataAgentImpl/local</attribute>
  |         <attribute name="SchedulableArgumentTypes">java.lang.String,java.lang.String,java.lang.String,java.lang.String</attribute>
  |         <attribute name="InitialStartDate">NOW</attribute>
  |         <attribute name="SchedulePeriod">180000</attribute>
  |         <attribute name="InitialRepetitions">-1</attribute>
  |         <attribute name="FixedRate">true</attribute>
  |     </mbean>

Both schedulable classes ISUPAgentProxy and ImportNavDataProxy are deployed in the same jar-archive in the <jboss dir>/server/default/lib directory. This is to ensure that the schedulable jobs are started automatically with jboss server startup.

Both schedulable classes ISUPAgentProxy and ImportNavDataProxy 
call stateless session beans which perform the actual job. The call is done like this:

            InitialContext ic = new InitialContext();
  |             ImportNavDataAgent importNavDataAgent =
  |                     (ImportNavDataAgent) ic.lookup(urlString);
  |             importNavDataAgent.doSomething();

The schedulable class ImportNavDataProxy looks up a stateless session bean ImportNavDataAgent which performs a task that can take up to 2 hours.

I have the effect that this long running job blocks the whole scheduler (also other scheduled jobs) until the task is finished.

This effect is highly undesirable.
How can I trigger a job from inside a schedulable class which then runs independently of the scheduler? The scheduler is not supposed to wait for the termination of the job and carry on with its work in the sense of "fire and forget".

Who can help?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140516#4140516

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140516

More information about the jboss-user mailing list