Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Troubleshooting Timers

This section describes:

How to Retrieve Information About the Timer

You can retrieve information and cancel the timer through the Timer object. The methods available are cancel(), getTimeRemaining(), getNextTimeout(), getHandle(), and getInfo(). To compare for object equality, use the Timer.equals(Object obj) method.

How to Retrieve a Persisted Timer

Timers must be able to be persisted so that they can survive the life cycle of the bean (ejbLoad, ejbStore, and so on). You can retrieve a persisted Timer object through its handle. Retrieve the TimerHandle through the Timer.getHandle() method. Then, you can retrieve the persisted Timer object through the TimerHandle.getTimer() method.

Executing the Timer Within the Scope of a Transaction

The timer is normally created or cancelled within the scope of a transaction. Thus, the bean normally is configured as being within a transaction. Typically this is configured with RequiresNew. If the transaction is rolled back, then the container retries the timeout.

For more information on transactions, see the Oracle Containers for J2EE Services Guide.

What Does a NoSuchObjectLocalException Mean with Timers?

When you try to invoke a method on a timer object that has been either successfully invoked or cancelled, you will receive a NoSuchObjectLocalException.