Pass4itsure > 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:

Buy Now
Questions 5

OldBarBean is a stateless session bean written to the EJB 2.1 API with remote home interface. OldBarHome and remote component interface OldBar. FooBean is a stateless session bean written to the EJB 3.0 API. OldBarBean and FooBean are the only EJBs packaged in the ejb-jar. The FooBean portion of the ejb-jar. xml also declares an ejb-ref whose ejb-ref-name is ejb/oldBar. The ejb-ref is linked to OldBarBean. There are no other ejb dependencies defined. A business method foo in FooBean needs to access OldBarBean. Which is portable code to achieve this goal?

A. ©Remote private OldBar oldBar;

B. public void fooQ { try { InitialContext ic = new InitialContextO; Object obj = ic.lookup("ejb/oldBar"); OldBarHome OldBarHome = (OldBarHome) PortableRemoteObject.narrow(obj, OldBarHome.class); OldBar oldBar = oldBarHome.createO;

C. @EJB private OldBarHome OldBarHome; public void fooQ { try { OldBar oldBar = oldBarHome.createQ;

D. public void fooQ { try { InitialContext ic = new InitialContextO; OldBarHome OldBarHome = (OldBarHome) ic.lookup("ejb/oldBar"); OldBar oldBar = oldBarHome.createQ;

Buy Now
Questions 6

A developer writes a stateless session bean FooBean with one remote business interface FooRemote containing one business method foo. Method foo takes a single parameter of application-defined type MyData.

11.

public class MyData implements Java. io.Serializablej

12.

int a; 13.}

Method foo is implemented within the FooBean class as:

11.

public void foo(MyData data) {

12.

data.a = 2; 13.}

Another session bean within the same application has a reference to FooRemote in variable fooRef and calls method foo with the following code:

11.

MyData data = new MyDatafJ;

12.

data.a = 1;

13.

fooRef.foo(data);

14.

System, out. println(data. a);

What is the value of data, a when control reaches Line 14 of the client ?

A. 0

B. 1

C. 2

D. either1or 2

Buy Now
Questions 7

A session bean's business method throws an exception during execution. Which two are responsibilities of the Bean Provider when throwing the exception? (Choose two.)

A. For application exceptions, ensure that if the current transaction commits there will be no loss of data integrity.

B. For application exceptions, ensurethatthe current transaction will commit.

C. For system errors, when the client is remote, throw a java.rmi.RemoteException that wraps the original exception.

D. For checked exceptions from which the bean cannot recover, throw an EJBException that wraps the original exception.

Buy Now
Questions 8

The Java Persistent API defines certain rules for persistent entities. These rules are required by the persistent provider to manage entities at runtime. Which statement is correct, assuming NO mapping descriptor is used?

A. Entitiesmust extenda persistent base class.

B. Entities must implement the interface PersistentEntityto bemanaged bythepersistent provider.

C. Afield withoutatransient modifier mustbeannotated as ©Persistent tobe stored in the database.

D. A field without a transient modifier must be annotated as ©Transient to NOT be stored in the database.

Buy Now
Questions 9

Given:

5.

public interface MrB1 {

6.

public interface MrB2 { Ajava class is defined as:

11.

©Stateless

12.

public class MrBean implements MrB1 ,MrB2 {

Which two statements are correct for making this code work as a stateless session bean, considering that this session bean is NOT defined in a deployment descriptor and the interfaces do NOT have annotations? (Choose two.)

A. Only the inteface for remote usage must be annotated.

B. The interfaces MrB1 and MrB2 can only be used locally without changing the code.

C. Both interfaces MrB1 and MrB2 must be annotated to make this a working stateless session bean.

D. The interfaces MrB1 and MrB2 can be annotated differently, one with @Local and the other with @Remote.

Buy Now
Questions 10

The Java Persistence API defines the Query interface. Which two statements about the Query.executeUpdate method are true? (Choose two.)

A. Itmust always be executed within a transaction.

B. It throws a PersistenceException if no entities were updated.

C. It throws an HlegalStateException if called on a Query instance created with a Java Persistence SELECT query.

D. All managed entity objects corresponding to database rows affected by the update will have their state changed to correspond with the update.

Buy Now
Questions 11

A Java EE 5 application contains a session bean which uses a security role USER. A group called people is defined in an LDAP server. Which two define appropriate EJB role responsibilities? (Choose two.)

A. The deployer definesandconfigures the LDAP realm.

B. The system administratordefines and configuresthe LDAPrealm.

C. Thedeployermaps the application role USER totheLDAP group people.

D. Thesystem administrator maps the application role USER totheLDAP group people.

Buy Now
Questions 12

Your application uses the Java Persistence API to access a database. This application must reject adding an instance to the database if it does NOT pass validation tests for values of two persistence properties. The database contains some data that will NOT pass such validation. Only the new records must be validated. Which option will achieve this behavior?

A. Add validation logic tothesetter methods for each property.

B. AddthePrePersist callbackmethodwithallofthevalidation logic.

C. Addthe PostPersist callback methodwithall ofthevalidation logic.

D. AddPrePersist and PreUpdate callback methods with allofthe validation logic.

Buy Now
Questions 13

The Java Persistent API defines certain rules for persistent entities. These rules are required by the persistent provider to manage entities at runtime. Which statement is correct, assuming NO mapping descriptor is used?

A. Entitiesmust extenda persistent base class.

B. Entities must implement the interface PersistentEntityto bemanaged bythepersistent provider.

C. Afield withoutatransient modifier mustbeannotated as ©Persistent to be stored in the database.

D. A field without a transient modifier must be annotated as ©Transient to NOT be stored in the database.

Buy Now
Exam Code: 1Z0-860
Exam Name: Java Enterprise Edition 5 Business Component Developer Certified Professional Exam
Last Update: Apr 19, 2024
Questions: 305
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$45.99

VCE

$49.99

PDF + VCE

$59.99