2016-08-31

There is a good interactive space about Testking. You can chat with examinees. Learn via each other along with make progress together. The candidates who have approved the Other Oracle Certification 1Z0-895 forum exam may pass on their own wisdom to you. Make full usage of their Other Oracle Certification examination notes. They may be an invaluable asset on your Oracle Other Oracle Certification exam preparation. You will find the most advanced, correct and guaranteed Oracle 1Z0-895 brain dumps exam questions along with answers. You will be ready to the Other Oracle Certification 1Z0-895 forum exam questions on the examination day. Learn more 1Z0-895 forum knowledge and lay a solid foundation for advancements throughout Oracle Other Oracle Certification 1Z0-895 forum career.



Leading 1Z0-895 Simple Questions Latest Practice Test Questions VCE PDF Dumps

Qustion No. 1

Suppose an EJB named HelloWorldBean is deployed as a standalone ejb-jar. Assuming the HelloWorldBean is implemented as follows: Which HelloWorldBean methods are accessible by another EJB within the same ejb-jar?

A. All of the methods declared in HelloWorldBean

B. All of the methods declared in HelloWorld and HelloWorldBean

C. All of the public methods declared in HelloWorldBean

D. All of the public methods declared in HelloWorld and all of the methods declared in HelloWorldBean

Answer: C

Qustion No. 2

A developer writes an interceptor class called FooInterceptor containing the following AroundInvoke method:

11. @AroundInvoke

12. public Object intercept (InvocationContext ctx)

13. return “intercepted”;

14.

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

11. @Interceptors (FooInterceptor.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 interceptor method is NEVER invoked.

B. The client receives a return value of “zero”.

C. The client receives a return value of “not zero”.

D. The client receives a return value of “intercepted”.

Answer: D

Qustion No. 3

A developer implements a CMT session bean with a method storeBoth which inserts data both a related database and an LDAP server. The relational database supports transactions while the LDAP system does NOT.

Given that both updates should succeed or be rolled back, while is the best solution?

A. Implement the SessionSynchoronization interface in the session bean. In the afterCompleteion method, the LDAP inserts are rolled back if false is passed as an argument to the afterCompletion method.

B. Define the transaction attribute of the method storeBoth as REQUIRED. The container manages the transactions and will roll back modifications if something goes wrong in either database insert or LDAP insert.

C. Define the transaction attribute of the method storeBoth as REQUIRED_NEW. Carry out the database insert first. Subsequently, execute the LDAP inserts, catching LDAP exceptions. If exceptions are raised, call the SessionContext.setRollBackOnly method.

D. Define the transaction attribute of the method storeBoth as REQUIRED_NEW. Carry out the LDAP insert first. If SessionContext.getRollBackOnly returns false, execute the database inserts, catching SQL exceptions. If exceptions are raised, call the SessionContext.setRollBackOnly.

Answer: C

Explanation: The method should start a new transaction, so we use the REQUIRED_NEW attribute.

For the LDAP operation we can only detect LDAP exceptions. We cannot check the status of the LDAP operation through SessionContext.getRollBackOnly.

Note:

* CMT — Container-Managed Transactions

* RequiresNew Attribute If the client is running within a transaction and invokes the enterprise bean’s method, the container takes the following steps:

Suspends the client’s transaction

Starts a new transaction

Delegates the call to the method

Resumes the client’s transaction after the method completes

If the client is not associated with a transaction, the container starts a new transaction before running the method.

You should use the RequiresNew attribute when you want to ensure that the method always runs within a new transaction. Reference: The Java EE 5 Tutorial, Container-Managed Transactions

Qustion No. 4

A stateless session bean FooBean implements an asynchronous business method foo() on its bean class:

@Asynchronous

public void foo() ( … )

The asynchronous business method is exposed through a remote business interface FooRemote. A caller acquires an EJB reference to this bean and invokes it as follows:

100. fooRemoteRef.foo();

Which exception can result from the invocation on line 100?

A. java.rmi.RemoteException

B. java.util.concurrent.ExecutionException

C. javax.ejb.EJBException

D. java.lang.IllegalArgumentException

Answer: A

Explanation:

Note:

* RemoteRef represents the handle for a remote object. A RemoteStub uses a remote reference to carry out a remote method invocation to a remote object.

* invoke

public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception Invoke a method. This form of delegating method invocation to the reference allows the reference to take care of setting up the connection to the remote host, marshaling some representation for the method and parameters, then communicating the method invocation to the remote host. This method either returns the result of a method invocation on the remote object which resides on the remote host or throws a RemoteException if the call failed or an application-level exception if the remote invocation throws an exception. Parameters:

Qustion No. 5

A developer writes a Singleton bean that uses the java Persistence API within a business method:

Two different concurrently executing caller threads acquire an EJB reference to PersonBean and each invoke the getPerson () method one time. How many distinct transaction are used to process the caller invocations?

A. 0

B. 1

C. 2

Answer: B

Explanation: Only one transaction is required. LockType READ allows simultaneous access to singleton beans.

Note: READ

public static final LockType READ For read-only operations. Allows simultaneous access to methods designated as READ, as long as no WRITE lock is held.

Reference: javax.ejb, Enum LockType

Testking provides your examinees with the no cost downloadable 1Z0-895 test question exam questions. You can require a quiz to have a look at the questions along with answers quality involving ourOracle Other Oracle Certification training materials before an individual purchase this. It is additionally helpful for you to seek out your own Other Oracle Certification exam weakness, then you definitely should perform harder on this kind of in your after study. Each of the Other Oracle Certification certification study items can be purchased at Testking website. It is possible to download them pertaining to free based on your personal requires.

Authored By IT Certification.

Show more