nerdexam
Oracle

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…

High Availability

Question

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 associated. MyMsgBean's message listener method has transaction attribute REQUIRED, and is defined as follows: Which statement is true about the result of the message processing?

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)
  • A
    14% (3)
  • B
    71% (15)
  • C
    5% (1)
  • D
    10% (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

#MDB#CMT#RuntimeException#transaction rollback

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice