Oracle
1Z0-898 · Question #8
FooBean and BarBean are both EJB 3.0 stateless beans with container-managed transaction demarcation. All business methods in FooBean have transaction attribute REQUIRED, and all business methods in…
The correct answer is A. FooBean.foo method receives javax.ejb.EJBException. The exception will be thrown within the FooBean container. A standard EJBException will be thrown. The EJBException is thrown to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a…
Advanced Topics
Question
FooBean and BarBean are both EJB 3.0 stateless beans with container-managed transaction demarcation. All business methods in FooBean have transaction attribute REQUIRED, and all business methods in BarBean have transaction attribute REQUIRED_NEW. The business method foo in FooBean invokes the Business method bar in BarBean. Given: 10. Public class BarBean { 11. public void bar () { 12. throw new RuntimeException ("unexpected error . . . "); 13. }} Which is true about the method of invocation assuming execution reaches line 12?
Options
- AFooBean.foo method receives javax.ejb.EJBException.
- BThe BarBean bean instance is in ready state for the next invocation.
- CFooBean.foo method receives javax -ejb. EJBTtansactionRolledbackException.
- DFooBean.foo method receives the original RuntimeException thrown from BarBean.bar method.
How the community answered
(42 responses)- A71% (30)
- B10% (4)
- C2% (1)
- D17% (7)
Explanation
The exception will be thrown within the FooBean container. A standard EJBException will be thrown. The EJBException is thrown to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database
Topics
#RuntimeException propagation#REQUIRES_NEW#EJBException#transaction boundary
Community Discussion
No community discussion yet for this question.