1.
Consider the following classes:
11. @Entity Auction {
12. @ld int id;
13. @OneToOne Item item;
14. }
11. @Entity Item {
12. @ld int id;
13. @OneToOne (mappedBy="item") Auction auction;
14. }
Given that the Auction entity maps to an AUCTION database table and the Item entity maps to an ITEM database table, which statement is correct assuming there
is NO mapping descriptor?
2.
A developer is implementing an EJB 3.0 message. driven bean that will be associated with a JMS topic. The bean must NOT miss any messages published to the
topic, even if the EJB server is down for some time. Which is correct?
3.
Which option will a developer use to obtain a MessageDrivenContext in a message. driven bean class written to the EJB 3.0 API?
4.
Given a set of CMT bean methods with the following transaction attributes:
Method M1=SUPPORTS
Method M2=REQUIRED
Method M3=NOT_SUPP0RTED
Method M4=REQUIRES_NEW
And the following method invocation sequence:
Method M1 invokes Method M2
Method M2 invokes Method M3
Method M1 invokes Method M4
If Method M1 is invoked by a method that does NOT have a transaction context, which describes a possible scenario?
5.
A developer wants to create a Java Persistence query to perform a bulk update operation on five different entity classes. All of these classes have a field called
name. These classes have the following relationships: Harrier extends Dog and Dog extends Animal Vet extends Doctor What is the minimum possible number of
operations required to change the value of the name field for all of the entities in all five classes?
6.

Which statement is true about the use of a persist operation in a transaction?
7.
A developer creates a stateless session bean. This session bean needs data from a remote system. Reading this data takes a long time. Assume that the data will
NOT change during the lifetime of the bean and that the information to connect to the remote system is defined in JNDI. Which statement describes how to manage
the data correctly?
8.
A developer wants to create a portable EJB 3.0 application that includes the following class definition for the Entity Account:
11. @Entity
12. @EntityListeners(com.acme.AlertMonitor.class)
13. public class Account {
14. //more code here
15. @PrePersist
16. protected void validateCreate() {/* more code here */}
17. }
Which statement is correct?
9.
A CMT session bean named MrBean contains a method storeStuff which is annotated as follows:
22. @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
23. public void storeStuff() {
All other methods of this bean have no transaction annotations.
Given the following part of an ejB. jar.xml:
23.
24.
25. MrBean
26. *
27.

28. NotSupported
29.
Which statement is correct about the methods in MrBean?
10.
The Java Persistence API defines a notion of propagation of a persistence context. Which statement is correct?