Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Troubleshooting Timers

This section describes the following:

Retrieving Information About a 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.

Retrieving 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.

Note:

Timers and their handles are local objects; therefore, try not to pass them through the bean remote interface.

Executing a Timer Within the Scope of a Transaction

You usually create and cancel a timer within the scope of a transaction. Thus, you usually configure the bean as being within a transaction by using 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.