Glassfish expunges the timer of a callback method if during the execution of the callback method a called services throws an application exception. The timer will be expunged even if the callback method handles the exception and finishes properly.
On the mailing list Marina Vatikna commented on my post:
GF retries once (you can change the setting to retry more times), but after all retries failed, the timer is expunged.
In my opinion the timer must not be expunged. The EJB 3.1 and 3.2 specification require only that a callback method does not throw an exception. In the scenario described above the callback method fullfils this requirement.
From my point of view this behaviour makes it impossible to write a reliable service because as the programmer of the callback method the only thing I can do is to read and to keep the requirements of the specification.
Furthermore the only possible solution to recover from this scenario is to restart the server or to redeploy the application.
I developed a small sample application to demonstrate this behaviour of Glassfish. You can find it at https://bitbucket.org/obfischer/glassfish-timerproblem
I also ran this example application with JBoss and with Apache Geronimo. Both do not expunge the timer.
Please ensure that Glassfish does not expunge the timer. This will help us to write reliable and portable applications based on Glassfish.