1Z0-895 · Question #12
MyMsgBean is a JMS message-driven with container-managed transaction demarcation. FooBean is an EJB 3.x stateless session bean that sends messages to the JMS destination with which MyMsgBean is…
The correct answer is B. The container discards the MyMsgBean bean instance. *Required Attribute If the client is running within a transaction and invokes the enterprise bean's method, the method executes within the client's transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method…
Question
Options
- AFooBean receives javax.ejb.EJBException.
- BThe container discards the MyMsgBean bean instance.
- CFooBean receives the original RuntimeException thrown from the message listener method.
- DThe container does NOT roll back the transaction, and FooBean can continue the transaction.
How the community answered
(21 responses)- A14% (3)
- B71% (15)
- C5% (1)
- D10% (2)
Explanation
*Required Attribute If the client is running within a transaction and invokes the enterprise bean's method, the method executes within the client's transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method. The Required attribute is the implicit transaction attribute for all enterprise bean methods running with container-managed transaction demarcation. You typically do not set the Requiredattribute unless you need to override another transaction attribute. Because transaction attributes are declarative, you can easily change them later.
Topics
Community Discussion
No community discussion yet for this question.