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


QUESTION: 56
Which statement is true about the Timer service in an EJB 3.0 stateless session bean?

A. The timeout callback method contains the business logic that handles the timeout event.
B. The timeout callback method must be declared as a business method in business interfaces.
C. The timeout callback method can throw application exceptions to report business logic
failures.
D. A bean class can implement multiple timeout callback methods, each associated with a
different timer.
Answer(s): A
QUESTION: 57
A developer wants to create a portable EJB 3.0 application that includes the following class
definition for the Entity Account:
11.?Entity
12. @Entityl_isteners(com. acme.AlertMonitor. class)
13. public class Account {
14. // more code here
15. @PrePersist
16. protected void validateCreate0 {/* more code here */}
17.}
Which statement is correct?

A. The validateCreate method may NOT throwruntimeexceptions.
B. ThevalidateCreate method can invoke the EntityManager.flush operation.
C. Methods oftheclass com.acme.AlertMonitor annotatedwithcal back annotationsmusttake an
Object or Account instance astheonly argument.
D. The above class definition is NOT correct. An entity cannot defineacal back methodlike
PrePersistand use the EntityListeners annotationatthe same time.
Answer(s): C
QUESTION: 58
Given this code snippet from a JMS message-driven bean class X:
11. public XQ { System, out. print("1 "); }
12. public void onMessagefMessage m) throws Java. rmi. RemoteException
13. try {
14. TextMessage tm = (TextMessage) m;
15. String text = tm.getText0;
16. System, out. print("2 ");
17. } catch (JMSException e) {
18. throw new java. rmi. RemoteExceptionQ;
19.}
20.}
When this bean class handles a message, which is correct?

A. After a messagedelivery theresultis1.


22

Viewing page 21 of 108



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

1Z0-860 Exam Discussions & Posts