• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Timer in Sun App Server

 
Dinesh Bang
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
We have a sample EJB timer inmplemented using a Session Bean. But the timer seems to be triggered in irregular fashion.

My sample code of Session Bean :
public void ejbTimeout(Timer timer){
System.out.println("NXT TIME OUT >>>>>>>>>>>>>>" +timer.getNextTimeout());
System.out.println("TIME REMAINIG OUT >>>>>>>>>>>>>>" +timer.getTimeRemaining());

}

public void testResult()throws java.rmi.RemoteException {
TimerService timerService = context.getTimerService();
timerService.createTimer(1000,1000,"TIMER" );
System.out.println("The timer service is invoked >>>>>>>>>>>>>>" );
}

And the output seems to be :
[#|2007-12-10T20:04:14.521+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=14;|
NXT TIME OUT >>>>>>>>>>>>>>Mon Dec 10 20:04:14 GMT+05:30 2007|#]

[#|2007-12-10T20:04:14.521+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=14;|
TIME REMAINIG OUT >>>>>>>>>>>>>>252|#]

[#|2007-12-10T20:04:21.630+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=15;|
NXT TIME OUT >>>>>>>>>>>>>>Mon Dec 10 20:04:21 GMT+05:30 2007|#]

[#|2007-12-10T20:04:21.630+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=15;|
TIME REMAINIG OUT >>>>>>>>>>>>>>143|#]

[#|2007-12-10T20:04:28.660+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=14;|
NXT TIME OUT >>>>>>>>>>>>>>Mon Dec 10 20:04:28 GMT+05:30 2007|#]

[#|2007-12-10T20:04:28.660+0530|INFO|sun-appserver-pe8.1_01|javax.enterprise.system.stream.out|_ThreadID=14;|
TIME REMAINIG OUT >>>>>>>>>>>>>>113|#]
 
Dinesh Bang
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any thoughts why we see , such a irregularity ?
We can see two different patterns of ejbTimout..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!