ejb@glassfish.java.net

[Fwd: [Fwd: Java EE Tutorial Feedback - Programming Question]]

From: Ian Evans <Ian.Evans_at_Sun.COM>
Date: Tue, 28 Aug 2007 11:37:45 -0700

Any ideas why the user is seeing this behavior with the Timer service?

-ian
-- 
Ian Evans
ian dot evans at sun dot com
Java EE technical documentation

attached mail follows:



You want to field this one? Here's a case where a user is taking your
basic example, timersession, and is trying to extend/enhance it. (But
she's encountering problems.) If you solve the problem, maybe it is
worth a look into whether you want to add it as an enhancement to the
example?

~Eric

attached mail follows:



name: Ami Tabak
url: http://java.sun.com/javaee/5/docs/tutorial/doc/Session4.html
chapter: SessionBean
tutorial_version: EE 5
comments: I run the timersession example.
As to try a more real life example I then changed the TimerSessionBean so instead of a single event the timer will run a repeatative mode. I did that by changing the code to:
 Timer timer = timerService.createTimer(0, intervalDuration, "Created new timer");
As to follow up on the accuracy of the events I've enhanced the log to:
logger.info(System.currentTimeMillis() + ": Timeout occurred");

The client doClient method is configured to call the bean with a value of 3000[mSec]

To my suprise the events are triggered every 7[sec] rather then 3[sec]

1188315664484: Timeout occurred
1188315671562: Timeout occurred
1188315678578: Timeout occurred
1188315685578: Timeout occurred
1188315692593: Timeout occurred

I've run similar Time mechansims based on MBean infrastructure and it workes perfectly so the issue is not with the hardware / OS / JVM.

Any suggestions

Best regards

Ami Tabak
mailfrom: amitabak_at_gmail.com
mailsubject: Java EE Tutorial Feedback - Programming Question
thanks_url: http://java.sun.com/javaee/5/docs/tutorial/information/auto-reply.html
category: javaee
Time Stamp: Tue Aug 28 08:42:21 PDT 2007
Feedback Page Referer: http://java.sun.com/javaee/5/docs/tutorial/doc/Session4.html

-----------------------------------------------------
Remote host : 89.1.216.104
Remote IP address : 89.1.216.104
Remote Agent : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Script : http://developers.sun.com/jsp_utils/form_mailer.jsp
Referring URL : http://developers.sun.com/contact/feedback.jsp?&category=javaee
-----------------------------------------------------