A developer implements a stateless session bean as a timed object. The bean contains two local business methods with the transaction attribute REQUIRED.

A client begins a UserTransaction and calls the foo local business method. The foo method returns five seconds later. The client rolls back the transaction and then calls the bar local business method. Assuming there have been no other client invocations on the stateless session bean, what is the value of the size variable when control reaches Line 18?
Correct Answer: A
Explanation/Reference:
An enterprise bean usually creates a timer within a transaction. If this transaction is rolled back, the timer creation also is rolled back.
The transaction will roll back. The creation of the timer will rock back. There will be zero timers.
Note: The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.
rollback() rolls back the transaction associated with the current thread.
Note 2: size()
Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
Reference: The Java EE 6Tutorial. PartNo: 821- Transactions andTimers