Skip to main content

1Z0-860 Real Exam Questions

Java Enterprise Edition 5 Business Component Developer Certified Professional

305 questions available · Page 1 of 31

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

FooBean and BarBean are both EJB 3.0 stateless session beans with container-managed transaction demarcation. All business methods in the two beans have transaction attribute REQUIRED. The business method foo in FooBean invokes the business method bar in BarBean. Given :
10. public class BarBean {
11. public void bar0{
12. throw new EJBException("unexpected error..."); 13.}

Which statement is true about the result of this method invocation assuming execution reaches Line 12?

  1. A

    Thecontainer mightroll back the transaction.

  2. B

    TheBarBean bean instance is in the ready stateforthe next invocation.

  3. C

    FooBean.foomethod receives javax.ejb.EJBTransactionRolledbackException.

  4. D

    FooBean.foo method receives javax.transaction.InvalidTransactionException.

Show answer and explanation

Correct answer: C

Question 2 Single choice

A Reader entity has a one-to-many, bidirectional relationship with a Book entity. Two Reader entities are persisted, each having two Book entities associated with them. For example, readeM has booka and bookb, while reader2 has bookc and bookd.

Which query returns a Collection of fewer than four elements?

  1. A

    SELECT b.reader FROM Book b

  2. B

    SELECT r FROM BookbINNER JOINb.readerr

  3. C

    SELECTrFROM Reader r INNER JOIN r.booksb

  4. D

    SELECTrfrom BookbLEFT JOIN b.readerr LEFTJOINFETCHr.books

Show answer and explanation

Correct answer: C

Question 3 Single choice

A developer wants to perform programmatic access control inside EJB 3.0 session beans. This is needed because some permissions can be determined only at application runtime.

Which method achieves this goal?

  1. A

    javax.ejb.EJBContext.getRollbackOnlyO

  2. B

    java.lang.SecurityManager.checkAccess(Thread t)

  3. C

    javax. interceptor. InvocationContext. getTargetO

  4. D

    javax. ejb. SessionContext.isCallerlnRole(String roleName)

  5. E

    javax. servlet. http. HttpServletRequest. getUserPrincipalQ

Show answer and explanation

Correct answer: D

Question 4 Single choice

Which statement is true about both stateful session beans and stateless session beans?

  1. A

    Bean instances are NOT required to survive container crashes.

  2. B

    Any bean instance must be able to handle concurrent invocations from different threads.

  3. C

    A bean with bean-managed transactions must commit or roll back any transaction before returning from a business method.

  4. D

    The container passivates and activates them using methods annotated with @PrePassivate and
    @PostActivate annotations.

Show answer and explanation

Correct answer: A

Question 5 Single choice

A Reader entity has a one-to-many, bidirectional relationship with a Book entity. Two Reader entities are persisted, each having two Book entities associated with them. For example, reader! has booka and bookb, while reader2 has bookc and bookd.

Which query returns a Collection of fewer than four elements?

  1. A

    SELECT b.reader FROM Book b

  2. B

    SELECT r FROM BookbINNER JOINb.readerr

  3. C

    SELECTrFROM Reader r INNER JOIN r.booksb

  4. D

    SELECTrfrom BookbLEFT JOIN b.readerr LEFTJOINFETCHr.books

Show answer and explanation

Correct answer: C

Question 6 Single choice

Which two statements are correct about EJB 3.0 stateful session beans and stateless session beans? (Choose two.)

  1. A

    Bothcan have multiple remote and local business interfaces.

  2. B

    Both can be passivated by the EJB container to preserve resources.

  3. C

    Both can choose to implement the javax. ejb.SessionSynchronization interface.

  4. D

    Only the stateful session bean class is required to implement java.io.Serializable

  5. E

    Both beanclasses can have the field injection of javax. persistence. EntityManager.

Show answer and explanation

Correct answer: A

Question 7 Single choice

Given the following stateful session bean :

10. @Stateful
11. public class VideoBean implements Video {
12. public void methodAOJ}
13.
14. @TransactionAttribute(TransactionAttributeType. SUPPORTS)
15. public void methodB0 {} 16.
17. public void methodC0 {}
18. @TransactionAttribute(TransactionAttributeType. REQUIRED) 19.
20. public void methodD0 {}
21.}
Assuming no other transaction-related metadata, which is true?

  1. A

    methodBand methodC have transaction attribute SUPPORTS, while methodD has transaction attribute REQUIRED.

  2. B

    methodAand methodChavetransaction attribute REQUIRES_NEW, while methodB has transaction attribute SUPPORTS.

  3. C

    methodC, methodD, and methodA havetransactionattribute REQUIRED, andmethod Bhastransactionattribute SUPPORTS.

  4. D

    methodB has transaction attribute SUPPORTS, methodD has transaction attribute REQUIRED, and
    methodAandmethodC have transaction attribute REQUIRES NEW.

Show answer and explanation

Correct answer: C

Question 8 Multiple choice

A developer examines a list of potential enterprise applications and selects the most appropriate technologies to use for each application.
For which two applications is EJB 3.0 an appropriate solution? (Choose two.)

  1. A

    torenderaGUI for mobile clients

  2. B

    as a container for web-tier components including JSP

  3. C

    as a Web serviceendpointaccessedbynon-Java clients

  4. D

    to receiveandrespondto HTTP Postrequests directly fromaweb browser

  5. E

    asanonline shoppingcart whichcan persist across multiple sessions with a single client

Show answer and explanation

Correct answers: C, E

Question 9 Multiple choice

An enterprise bean has security permissions set up using declarative security features.
Under which two conditions can a client be guaranteed to have permission to invoke a business method on the enterprise bean? (Choose two.)

  1. A

    The Application Assembler has marked the enterprise bean methodasunchecked.

  2. B

    The client's principalhas beenassigned a securityrolewithpermissionto invokethe method.

  3. C

    The Application Assembler has set the security-identity deployment descriptor to run-as.

  4. D

    TheApplicationAssemblerhas mapped all security role references using the role-link element.

Show answer and explanation

Correct answers: A, B

Question 10 Single choice

A Java Persistence application wants to use optimistic locking.

Which statement that describes the functionality of optimistic locking is correct?

  1. A

    The Version attribute of an entity using optimistic locking can be mapped to a secondary table.

  2. B

    Optimistic locking can be used by Java Persistence applications to set optimistic locks on tables in the database.

  3. C

    The Version attribute of an entity using optimistic locking is verified each time the instance is loaded from the database.

  4. D

    Optimistic locking ensures that updates or deletes are consistent with the current state of the database and that intervening updates are not lost.

Show answer and explanation

Correct answer: D