This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi Ranchers, Can you provide answers for the below mock questions with explanation.
1)Which Statement about the entity manager is true?
A) A container managed entity manager must be a JTA entity manager. B) An entity manager injected 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 thro resource injection in stateful session beans can use resource local Entity transaction for transaction control
my Answer: A
2)Which java persistence query uses the aggregate function correctly, assuming that the chairs field is of type int? my Answer: B
3)Bean A is using bean managed transaction demarcation and has invoked the too method of the bean B. when the too method retuns, bean A needs to determine if the transaction has been set to rollback. Which must be true? A) It is not possible for Bean A to determine if the transaction has been set to rollback B) Bean A must invoke the getStatus method on UserTransaction that it begins C)For this Bean b must also use bean managed transaction demarcation D) Bean A must invoke the setRollbackOnly method on UserTransaction that it begins E) Bean A must invoke the getRollbackOnly method on UserTransaction that it begins
my Answer: D
4)A developer wants to create a java persistence query that return the valid US phone number(formatted as "123-456-7890" or "800-RUN-EJB3") from the collection of differently formatted international phone numbers.The developer needs only those number which begin with 303. Which where clause is correct.
my Answer: B
5)A Reaser entity has one-to-many , bidir relnship wih a book entity.Two reader entity are persisted , each having two book entitied assiciated with them. For ex r1 has book a and book b. r2 has book c and book d. Which query returns a collection of fewer than 4 elements?