How many distinct transactions are started by the container after all processing has completed?

Given two stateless session beans, ABean and BBean:

A client that is not executing within a transaction acquires an EJB reference to ABean and invokes
the a() method on time. How many distinct transactions are started by the container after all
processing has completed?

Given two stateless session beans, ABean and BBean:

A client that is not executing within a transaction acquires an EJB reference to ABean and invokes
the a() method on time. How many distinct transactions are started by the container after all
processing has completed?

A.
0

B.
1

C.
2

D.
3

Explanation:
Note: REQUIRED
If a client invokes the enterprise bean’s method while the client is associated with a transaction
context, the container invokes the enterprise bean’s method in the client’s transaction context.
Reference: Enum TransactionAttributeType



Leave a Reply 8

Your email address will not be published. Required fields are marked *


Marian

Marian

C

Tamer

Tamer

No, its B
The client -no T- will call a(), then the container will start a new T, then call b() within the same T and then commit, so its only one T

Tamer Saleh

Tamer Saleh

No, its C.

4.5.3Transactions
Client transaction context does not propagate with an asynchronous method invocation. From the Bean Developer’s view, there is never a transaction context flowing in from the client. This means, for example, that the semantics of the REQUIRED transaction attribute on an asynchronous method are exactly the same as REQUIRES_NEW.

Livious

Livious

Answer is C.

Because ABean does not specify the transaction attribute REQUIRED will be used. Calling the asynchrous method the transaction context will not be propagated, a new transaction will be created.

Bruno Mathidios

Bruno Mathidios

Tamer Saleh and Livious are right! The correct is C

Rafael

Rafael

The correct is B.

Rafael

Rafael

Sorry. I see now. The correct is C.