Free 1Z0-860 Braindumps

Answer(s): A
Which statement is true about the use of a persist operation in a transaction?

A. If a user persists a detached object it always becomes managed.
B. The persist operation on an entity always cascades to its related entities.
C. If a user persists a new entity with an existing primary key the transaction will fail.
D. If a user persists a managed entity an exception may be thrown by the persist operation.
Answer(s): C
A developer writes a stateless session bean with one local business interface and with
container- managed transactions. Al business methods have transaction attribute REQUIRED.
The bean has an injected field sessionCtx of the type SessionContext. Which two operations
are allowed in a business method of the bean? (Choose two.)

A. sessionCtx. getEJBObject
B. sessionCtx.setRollbackOnly
C. sessionCtx. getMessageContext
D. sessionCtx. getBusinessObject
E. sessionCtx. getEJBLocalObject
Answer(s): B, D

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.getCal erPrincipal 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".
Answer(s): B, D
Which Java Persistence query uses the aggregate function correctly, assuming that chairs field
is of type int?

A. SELECT ANY(r. chairs) FROM Room r
B. SELECT NEW Integer(MAX(r. chairs)) FROM Room r


Get The Premium Version
 Test Questions PDF from

 Test Questions PDF from