Free Oracle 1Z0-860 Exam Braindumps (page: 7)

Answer(s): A
QUESTION: 21
Given this Java EE application that uses a JTA application-managed entity manager:
20. UserTransaction utx = ...;
21. utx.beginQ;
22. // insert code here
23. utx.commitQ;
Which two code fragments can be used on Line 22 to persist an order instance assuming that
all references are properly initialized? (Choose two.

A. em.merge(order); em.flushQ;
B. em.persist(order); em.flushO;
C. em.joinTransactionO; em.persist(order);
D. em = emfcreateEntityManagerQ; em.persist(order);
Answer(s): C, D

QUESTION:
22
A developer writes two session beans which cooperate. The first session bean, ShoppingCart,
collects orders and is implemented as a stateful session bean. The second session bean,
CalculateDiscount, is implemented as a stateless session bean and runs on a different server.
ShoppingCart contains the method getTotalPrice, which calculates the total price of the order in
the ShoppingCart, including discounts. Discounts are calculated by CalculateDiscount using the
information on the ShoppingCart bean, combined with data from a database. Which scenario
can accomplish this?

A. The CalculateDiscount offers a method calculate which is invoked by the ShoppingCart bean
passing the this reference.
B. The CalculateDiscount offers a method calculate which is invoked by the ShoppingCart bean.
CalculateDiscount accesses the ShoppingCart instance by JNDI lookup.
C. The CalculateDiscount offers a method calculate which is invoked by the ShoppingCart bean
passing its reference obtained from the SessionContext.getBusinessObject method.
D. The CalculateDiscount offers a method calculate which is invoked by the ShoppingCart bean.
CalculateDiscount accesses the state of ShoppingCart by dependency injection.
Answer(s): C
QUESTION: 23
A CMT session bean named MrBean is annotated as follows :
21. @Stateless(name="MrBean")
22. @TransactionAttribute0"ransactionAttributeType.NOT_SUPPORTED)
23. public class MrBean {
24. public void storeStuffQ {}
25. There are no transaction annotations at the method level.
Given the following snippet of an ejb-jar.xml:
23. <container-transaction>


8

Viewing page 7 of 108
Viewing questions 25 - 28 out of 305 questions



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

1Z0-860 Exam Discussions & Posts