QUESTION: 1
Given the following stateful session bean:
10. @Stateful
11. @TransactionAttributefJransactionAttributeType. SUPPORTS)
12. public class VideoBean implements Video {
13. // insert code here
14. public void methodAO {}
15.}
Assuming no other transaction-related metadata, which code can be added at Line 13 to
guarantee that business method methodA wil execute only if invoked with an active
transaction?
A. @TransactionAttributefJ
B. @TransactionManagement(TransactionAttributeType. CONTAINER)
C. @TransactionAttribute(TransactionAttributeType.MANDATORY)
D. @TransactionAttributeO"ransactionAttributeType.REQUIRES_NEW)
Answer(s): C
QUESTION: 2
Given the following client-side code that makes use of the session bean Foo:
10. @EJB Foo beanl;
11. @EJB Foo bean2; //more code here
20. booleantestl = beanl.equals(beanl);
21. booleantest2 = beanl.equals(bean2);
Which two statements are true? (Choose two.)
A. If Foo isstateful, testlistrue, and test2 is true.
B. IfFoo is stateful, testlis true, andtest2isfalse.
C. IfFoo is stateless, testl is true, and test2 is true.
D. IfFoois stateful, testl is false, and test2 is false.
E. If Foo isstateless, testl istrue, and test2 is false.
F. If Fooisstateless, testl is false, andtest2is false.
Answer(s): B, C
QUESTION: 3
Which statement about entity manager is true?
A. A container-managed entity manager must be a JTA entity manager.
B. An entity manager injected into session beans can use either JTA or resource-local
transaction control.
C. An entity manager created by calling the EntityManagerFactory.createEntityManager method
always uses JTA transaction control.
D. An entity manager obtained through resource injection in a stateful session bean can use a
resource-local EntityTransaction for transaction control
2