[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-895 Dumps with VCE and PDF Download 41-50

EnsurePass 2018 Jan Oracle Official New Released 1z0-895
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-895.html

Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam

Question No: 41

Given the stateful session bean:

Ensurepass 2018 PDF and VCE

Assuming no other transaction-related metadata, which is true?

  1. methodB and methodC have transaction attribute SUPPORTS, which methodD has transaction attribute REQUIRED.

  2. methodA and methodC have transaction attribute REQUIRES_NEW, while methodB has transaction attribute SUPPORTS.

  3. methodC, methodD, and methodA have transaction attribute REQUIRED, and methodB has transaction attribute SUPPORTS.

  4. methodB has transaction attribute SUPPORTS, methodD has transaction attribute REQUIRED, and methodA and methodC have transaction attribute REQUIRES_NEW.

Answer: C

Question No: 42

Given a set of CMT bean methods with the following transaction attributes:

Method M1 = SUPPORTS Method M2 = REQUIRED Method M3 = NOT_SUPPORTED Method M4 = REQUIRES NEW

And the following method invocation sequence:

Method Ml invokes Method M2 Method M2 invokes Method M3 Method M1 invokes Method M4

If Method Ml is invoked by a method that does NOT have a transaction context, which describes a possible scenario?

  1. Method M1: no transaction Method M2: new transaction Method M3: no transaction Method M4: new transaction

  2. Method M1: no transaction

    Method M2: Container throws EJBTransactionRequiredException

  3. Method M1: new transaction

    Method M2: runs in same transaction as M1

    Method M3: Container throws TransactionNotSupportedException

  4. Method M1: no transaction Method M2: new transaction

Method M3: Container throws TransactionNotSupportedException

Answer: A

Question No: 43

A stateful session bean needs to restore its conversational state to its initial state if the transaction in which the bean is participating rolls back.

Which bean method can be used to do this?

  1. SessionContext.setRollbackOnly

  2. SessionContext.getUserTransaction

  3. SessionSynchronization.afterCompletion

  4. SessionSynchrinization.beforeCompletion

Answer: C

Explanation: The afterCompletion method notifies a stateful session bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.

Returns:

True if the current transaction is marked for rollback, false otherwise.

Reference: javax.ejb, Interface SessionSynchronization

Question No: 44

A developer implements a session bean which acts as a session facade for an application. This means that clients will only see this session bean#39;s interface which offers the application interface, where are three distinct roles known at development time: quot;userquot;, quot;adminquot;, and quot;guestquot;. The majority of the methods will be used by role quot;userquot;. All methods must have role permissions active and roles may be added or changed in the future.

Which two scenarios are correct? (Choose two.)

  1. The developer annotates the bean class with @PermitAll and annotates the methods used by role quot;guestquot; or quot;adminquot; individually.

  2. The developer annotates the bean class with @DenyAll and annotates the methods used by role quot;userquot;, quot;guestquot;, or quot;adminquot; individually.

  3. The developer defines individual method permissions for the methods used by roles quot;user quot;guestquot;, and quot;adminquot; In the deployment descriptor.

  4. The developer annotates the bean class with @RolesAllowed(quot;userquot;) and annotates the methods used by role quot;guestquot; or quot;adminquot; individually.

  5. The developer defines a method permission with method name quot;*quot; and role quot;userquot; and

adds individual method permissions for the methods used by roles quot;guestquot; and quot;adminquot; in the deployment descriptor.

Answer: D,E

Question No: 45

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

  1. The deployer defines and configures the LDAP realm.

  2. The system administrator defines and configures the LDAP realm.

  3. The deployer maps the application role USER to the LDAP group people.

  4. The system administrator maps the application role USER to the LDAP group people.

Answer: B,C

Question No: 46

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. The Application Assembler has marked the enterprise bean method as unchecked.

  2. The client#39;s principal has been assigned a security role with permission to invoke the method.

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

  4. The Application Assembler has mapped all security role references using the role-link element.

Answer: A,B

Question No: 47

Given a session bean defines:

  1. @Stateless (name = “MrBean”)

  2. public class source SecureBean implements local business, remoteBusiness {

Where LocalBusiness is a local business interface and RemoteBusines is a remote business interface.

The following deployment descriptor entries represent the only security-related metadata:

Ensurepass 2018 PDF and VCE

Which is true about the security roles of clients MrBean?

  1. Only LocalBusiness clients must be in role A.

  2. Only LocalBusiness clients must be in role B.

  3. Both LocalBusiness and RemoteBusiness Clients must be in role A.

  4. Both LocalBusiness and RemoteBusiness clients must NOT be in role A.

Answer: C

Question No: 48

Suppose a developer wants to create an automatic persistent timer that performs data validation every hour. Given the following stateless session bean:

@Stateless

Public class OrderVerificationBean { Private void verificationExternalOrders () {

/ / do something

}

}

What is the minimum modification you would need to make to the bean to create the automatic persistent timer?

  1. Modify the verifyExternalOrders methos to look like this:

    @Schedule

    private void verifyExternalOrders () {

    / do something

    }

  2. Modify the verifyExternalOrders method to look like this:

    @Schedule (hour = “*”)

    private void verifyExternalOrders () {

    / / do something

    }

  3. Modify the verifyExternalOrders method to look like this:

    @Schedule (persistent = true)

    private void verifyExceptionalOrders () {

    / / do something

    }

  4. Modify the verifyExternalOrders method to look like this:

@Schedule (hour = “*”, persistent = true) private void verifyExceptionalOrders () {

/ / do something

}

Answer: B Explanation:

Not D: Timers are persistent by default. If the server is shut down or crashes, persistent timers are saved and will become active again when the server is restarted. If a persistent timer expires while the server is down, the container will call the @Timeout method when the server is restarted.

Nonpersistent programmatic timers are created by calling TimerConfig.setPersistent(false) and passing the TimerConfig object to one of the timer-creation methods.

Question No: 49

A developer implements a stateless session bean as a timed object. The bean contains two local business methods with the transaction attribute REQUIRED.

Ensurepass 2018 PDF and VCE

A client begins a UserTransaction and calls the foo local business method. The foo method returns five seconds later. The client rolls back the transaction and then calls the bar local business method. Assuming there have been no other client invocations on the stateless session bean, what is the value of the size variable when control reaches Line 18?

  1. 0

  2. 1

  3. -1

Answer: A

Explanation: An enterprise bean usually creates a timer within a transaction. If this transaction is rolled back,the timer creation also is rolled back.

The transaction will roll back. The creation of the timer will rock back. There will be zero timers.

Note: The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.

rollback() rolls back the transaction associated with the current thread.

Note 2: size()

Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Reference: The Java EE 6Tutorial. PartNo: 821- Transactions andTimers

Question No: 50

A developer wants to create an enterprise bean that uses the EJB Timer service. Which two are true? (Choose two.)

  1. Once created, a timer cannot be canceled.

  2. The bean can be used within a transaction.

  3. Once created, the timer will survive a container crash.

  4. The enterprise bean must implement the TimedObject interface.

  5. The developer can use either a message-driven bean, stateless session bean, or stateful session bean.

Answer: B,C

Explanation: B: An enterprise bean usually creates a timer within a transaction. If this transaction is rolled back, the timer creation also is rolled back. Similarly, if a bean cancels a timer within a transaction

that gets rolled back, the timer cancellation is rolled back.

C: Timers are persistent by default. If the server is shut down or crashes, persistent timers are saved

and will become active again when the server is restarted. If a persistent timer expires while the

server is down, the container will call the @Timeout method when the server is restarted. Reference: The Java EE 6Tutorial. PartNo: 821- Transactions andTimers

100% Free Download!
Download Free Demo:1z0-895 Demo PDF
100% Pass Guaranteed!
Download 2018 EnsurePass 1z0-895 Full Exam PDF and VCE

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

2018 EnsurePass IT Certification PDF and VCE