Certbus > Oracle > Others Oracle Certifications > 1Z0-860 > 1Z0-860 Online Practice Questions and Answers

1Z0-860 Online Practice Questions and Answers

Questions 4

Click the Task button.

A Department entity is in a one-to-many relationship with an Employee entity. A developer has been asked to write a Java Persistence query to update the set of employees who are in the department 'HR' by setting their department to null.

Construct a query using the Java Persistence query language to perform this task. Construct a valid Java Persistence query by dragging and dropping the syntax fragements.

Select and Place:

Browse 305 Q&As
Questions 5

A developer wants to create a JMS message-driven bean that responds to javax.jms.TextMessage messages. Which two statements are true? (Choose two.)

A. The developer must implement the ejbCreate method.

B. The developer does NOT need to create a business interface for the bean.

C. The developer must implement a method that declares javax.jms.TextMessage as an argument.

D. The message-driven bean class must implement methods of the javax.jms.MessageListener interface.

E. The message-driven bean class must implement methods of the javax. ejb. MessageDnvenBean interface.

Browse 305 Q&As
Questions 6

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;

B. PersistenceUnit(unitName="BarPU") private EntityManagerFactory emf;

C. Resource(name="BarPU", type=EntityManagerFactory.class) private EntityManagerFactory emf;

Browse 305 Q&As
Questions 7

A developer implements a session bean with a method doStuff which behaves differently depending on the caller's security role. Only users in security roles "ADMIN" and "USER" are allowed to call the method. Assume that there is no security-related metadata in the deployment descriptor. Which two, taken in combination, are appropriate to accomplish this? (Choose two.)

A. Annotate method doStuff with @PermitAII.

B. AnnotatemethoddoStuff with@RolesAllowed({"ADMIN","USER"})

C. If EJBContext.getCallerPrincipal returns role "ADMIN", implement thebehaviorfor users in role ADMIN.

D. If EJBContext.isCallerlnRole("ADMIN") returns true, implement the behavior defined for users in role "ADMIN".

Browse 305 Q&As
Questions 8

You have been asked to develop business methods for an enterprise bean to fulfill the following objective:

If the JDBC connection is NOT available, the current state of the shopping cart session must be serialized. A serialized state must be written to a text file using a java.io.PrintWriter. Data must be shared with a Web services end point. Logging

information must be displayed in ajavax.swing.JPanel component.

Which is true?

A. The requirements can be fullfilled only in sessionbeans.

B. Therequirementscan befulfilled only in message-driven beans.

C. Allof the requirements can be fulfilled using either session beans or message-driven beans.

D. None of the requirements can be fulfilled using either session beans or message-driven beans.

E. Bothsession beansandmessage-driven beans canfulfillsomebutnotalloftherequirements.

Browse 305 Q&As
Questions 9

A developer obtains a Java, security. Principal object by calling the SessionContext.getCallerPrincipal method from within a business method of a session bean. Which statement is true?

A. The returned Principal object can be null.

B. The roles which the Principal is in can be determined from this Principal object.

C. The return value of Principal. getName depends on the security realm which was used to authenticate thecaller.

D. The return value of the Principal. getName method is exactly the same as the username used for authentication of the caller.

Browse 305 Q&As
Questions 10

Which must result in the destruction of a stateful session bean?

A. A client calls an @Remove method and the method returns successfully.

B. The server in which the stateful session bean was created is restarted.

C. The stateful session bean participates in a transaction that is rolled back.

D. The stateful session bean is chosen as a last recently used (LRU) victim for passivation.

Browse 305 Q&As
Questions 11

You have been asked to develop business methods for an enterprise bean to fulfill the following objective:

If the JDBC connection is NOT available, the current state of the shopping cart session must be serialized. A serialized state must be written to a text file using a java.io.PrintWriter. Data must be shared with a Web services end point. Logging

information must be displayed in ajavax.swing.JPanel component. Which is true?

A. The requirements can be fullfilled only in sessionbeans.

B. Therequirementscan befulfilled only in message-driven beans.

C. Allof the requirements can be fulfilled using either session beans or message-driven beans.

D. None of the requirements can be fulfilled using either session beans or message-driven beans.

E. Bothsession beansandmessage-driven beans canfulfillsomebutnotalloftherequirements.

Browse 305 Q&As
Questions 12

Given the method invocation sequence:

Method 1 calls Method 2 Method 2 calls Method 3 Method 1 calls Method 4 And the transaction scope:

Method 1Transaction A Method 2Transaction A Method 3Transaction A Method 4Transaction B Assuming Method 1 is invoked by a client without an existing transaction context, which set of transaction attributes will support this scope?

A. Method1NEVER Method 2SUPPORTS Method 3REQUIRED Method 4REQUIRES_NEW

B. Method1REQUIRES_NEW Method 2MANDATORYMethod 3SUPPORTS Method 4REQUIRES_NEW

C. Method1REQUIRES_NEW Method 2MANDATORY Method 3SUPPORTS Method 4SUPPORTS

D. Method 1MANDATORY Method 2REQUIREDMethod 3SUPPORTSMethod 4REQUIRES NEW

Browse 305 Q&As
Questions 13

Given this code snippet from a JMS message-driven bean class named MyMDB:

11.

public MyMDBOJ System, out. print("a "); }

12.

public void onMessage(Message m) { System, out. print("b "); }

13.

@PreDestroy

14.

public void removeQ { System, out. print("c "); } The container crashes and then restarts and then the bean class handles two messages.

Which four are possible results? (Choose four.)

A. abb

B. acbb

C. aa c bb

D. aab b c

E. a bcb c

F. ababc c

Browse 305 Q&As
Questions 14

A developer is declaring a persistent entity that will be passed as a detached object through a remote interface to an application client. Which two characteristics must the corresponding persistent entity class have? (Choose two.)

A. implement serializable

B. includeano-arg constructor

C. make instance variables public

D. implement the remote interface

Browse 305 Q&As
Questions 15

Which example of Java Persistence identity definitions is portable and correct assuming NO mapping descriptor is present?

A. ©Entity public class A { @ld private float id; // more code here }

B. @ldClass(com. acme. LineltemPK. class) ©Entity public class Lineltem { @ld int orderld; @ld int lineltemld; // more code here }

C. @Entity public class Project { @ld@GeneratedValue(strategy=TABLE) public String getProjectldQ {return pid;} // more code here }

D. ©Entity public class Employee { @ld public Java.util.Date getBirthdayO {return bday;} // more code here

Browse 305 Q&As
Questions 16

A developer has obtained a container-managed entity manager with transaction scoped persistence context. Assume there is no persistence context associated with the entity manager. When does a new persistence context begins?

A. whenaJTA transaction begins

B. when the entity manager is created

C. whenthe entitymanageris invoked in the scope of an active JTA transaction

D. when theentitymanager is created inthe scopeof an active resource local transaction

Browse 305 Q&As
Questions 17

A developer is writing client code for an EJB 3.0 message-driven bean that is listening on a JMS queue. Which statement is true?

A. The transaction context of the client is propagated to the bean.

B. If the bean instance crashes the client will need to resend all pending requests.

C. The client can call the bean method annotated with @Remove to remove the message-driven bean instance.

D. Requests sent by the client while the EJB server is down are processed by the bean after restarting the server.

Browse 305 Q&As
Questions 18

A developer writes an interceptor class called Foolnterceptor containing the following Aroundlnvoke method:

11.

@Aroundlnvoke

12.

public Object intercept(lnvocationContext ctx) {

13.

return "intercepted";

14.}

Foolnterceptor is applied to a business method in a stateless session bean:

11.

@lnterceptors(Foolnterceptor.class)

12.

public String testzero(int i) {

13.

return (i == 0) ? "zero""not zero";

14.

}

Which describes the result when a client invokes the testzero method with a value of 1?

A. The intercept method is NEVER invoked.

B. The clientreceivesareturnvalueof "zero".

C. The client receivesa returnvalue of "not zero".

D. The client receivesareturn value of "intercepted".

Browse 305 Q&As
Exam Code: 1Z0-860
Exam Name: Java Enterprise Edition 5 Business Component Developer Certified Professional Exam
Last Update: Apr 23, 2024
Questions: 305 Q&As

PDF

$45.99

VCE

$49.99

PDF + VCE

$59.99