Free Oracle 1Z0-860 Exam Questions (page: 20)

A developer wants to create a Java Persistence query to perform a bulk update operation on
five different entity classes. Al 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?

A. 1
B. 2
C. 3
D. 4
E. 5
Answer(s): B
QUESTION: 54
A developer writes an enterprise application and packages it into an .ear file. The application
contains two persistence units defined at the .ear level with persistence unit names FooPU and
BarPU. The application also contains an ejb-jar with one stateless session bean. Which code,
when added to the stateless session bean class, injects an EntityManagerFactory at runtime?

A. PersistenceUnit
private EntityManagerFactory emf;
B. PersistenceContext
private EntityManagerFactory emf;
C. PersistenceUnit(unitName="BarPU")
private EntityManagerFactory emf;
D. Resource(name="BarPU", type=EntityManagerFactory.class)
private EntityManagerFactory emf;
Answer(s): C
QUESTION: 55
A developer is working on a user registration application using EJB 3.0. A business method
registerUser in stateless session bean RegistrationBean performs the user registration.
The registerUser method executes in a transaction context started by the client. If some invalid
user data causes the registration to fail, the client invokes registerUser again with corrected
data using the same transaction. Which design can meet this requirement?

A. Have registerUser method call EJBContext.setRollbackOnlyOmethodafter registration fails.
B. Have registerUser method throw
javax.ejb.EJBTransactionRequiredExceptionafterregistration fails.
C. HaveregisterUser method throw EJBException without marking the transaction for rollback,
after registration fails.
D. Create an application exception withtherollbackattributeset to falseandhave registerUser
method throwit afterregistration fails.
Answer(s): D

21

Viewing page 20 of 108



Post your Comments and Discuss Oracle 1Z0-860 exam prep with other Community members:

1Z0-860 Exam Discussions & Posts