ejb@glassfish.java.net

Re: Java EE Tutorial Feedback - Programming Question

From: Ian Evans <Ian.Evans_at_Sun.COM>
Date: Wed, 05 Sep 2007 11:48:11 -0700

ami-t wrote:
> Thanks for the answer..
> However... I was talking about a 7 [*second*] delay, not 7 [mili sec] of
> which I'm aware as JVM doesn't support any real accuracy below 10 [mili
> second]...
>
> Question is why should the timer service ignore the setup and go for the
> 7 second interval?
>
> If run this example on you're box, do you get the same result ?

Oh, sorry about that.

I've re-tested the timersession example, and I'm seeing the same behavior.

However, I took a look at the domain.xml DTD, though, and Ken was
essentially right, but typed milliseconds instead of seconds.
Apparently, we all are making this mistake here at Sun. 8^)

The default isn't 7 milliseconds, but 7000 milliseconds (7 seconds):
<!--
...
     minimum-delivery-interval-in-millis

         is the minimum number of milliseconds allowed before the next
         timer expiration for a particular timer can occur. It guards
         against extremely small timer increments that can overload
         the server.
...
-->
<!ATTLIST ejb-timer-service
     minimum-delivery-interval-in-millis CDATA "7000"
     max-redeliveries CDATA "1"
     timer-datasource CDATA #IMPLIED
     redelivery-interval-internal-in-millis CDATA "5000">

So, change the value of minimum-delivery-interval-in-millis in
GlassFish's domain.xml to 3000 milliseconds (3 seconds).

Sorry for the confusion.

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