uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.12.4 Deleting the EJB timer

To delete the EJB timer, cancel the EJB timer.

Note that in the case of a single-event timer, the EJB timer is deleted when the callback of the timeout method finishes. In the case of an interval timer, the EJB timer is not deleted until the EJB timer is cancelled.

During the cancellation of the EJB timer, a single EJB timer is deleted by the EJB timer cancellation method (cancel method of the javax.ejb.Timer object). If the EJB timer is deleted, the subsequent callbacks are not executed. The timing for deleting the EJB timer by EJB timer cancellation depends upon whether the cancellation of the EJB timer is executed under transaction management.

When the EJB timer is cancelled under transaction management
The EJB timer is deleted when the transaction is committed. As a result, the time for a timeout may be reached during the period when the method for cancellation of the EJB timer is invoked until the transaction is committed.
When the transaction rolls back, cancellation of the EJB timer is cancelled.

When the EJB timer is not cancelled under transaction management
The EJB timer is deleted immediately after the method for cancellation of the EJB timer is invoked.
Reference note
When stopping the J2EE applications, all EJB timers of the J2EE applications to be stopped are deleted. When stopping a J2EE server or during its abnormal termination, all EJB timers on a J2EE server are deleted.