Oracle would be the prime multinational companies to supply a precious 1Z0-895 exams qualifications packages, This specialists, just one. In the Oracle qualifications, you are able to access information technology specialists towards peak regarding his particular career. To be able to employ the particular Oracle 1Z0-895 free download tests, it is suggested to obtain from your well-known 1Z0-895 Q&A education middle designed for education regarding pro workers.

certifyforall.com

Most up-to-date 1Z0-895 Simple Questions Latest Practice Test Questions VCE PDF Dumps

Qustion No. 1

MyMsgBean is a JMS message-driven with container-managed transaction demarcation. FooBean is an EJB 3.x stateless session bean that sends messages to the JMS destination with which MyMsgBean is associated. 

MyMsgBean’s message listener method has transaction attribute REQUIRED, and is defined as follows: 

Which statement is true about the result of the message processing? 

A. FooBean receives javax.ejb.EJBException. 

B. The container discards the MyMsgBean bean instance. 

C. FooBean receives the original RuntimeException thrown from the message listener method. 

D. The container does NOT roll back the transaction, and FooBean can continue the transaction. 

Answer: B 

Explanation: 

Note: 

* Required Attribute If the client is running within a transaction and invokes the enterprise bean’s method, the method executes within the client’s transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method. 

The Required attribute is the implicit transaction attribute for all enterprise bean methods running with container-managed transaction demarcation. You typically do not set the Required attribute unless you need to override another transaction attribute. Because transaction attributes are declarative, you can easily change them later. 

 

Qustion No. 2

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? 

A. Modify the verifyExternalOrders methos to look like this: @Schedule private void verifyExternalOrders () / do something 

B. Modify the verifyExternalOrders method to look like this: 

@Schedule (hour = “*”) 

private void verifyExternalOrders ()  

/ / do something 

 

C. Modify the verifyExternalOrders method to look like this: 

@Schedule (persistent = true) 

private void verifyExceptionalOrders ()  

/ / do something 

 

D. 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. 

 

Qustion No. 3

Assume you would like to receive notification from the container as a stateless session bean transitions to and from the ready state. 

Which of the following life cycle back annotations would you use? (Choose one.) 

A. @PostConstruct, @PostDestroy 

B. @PostConstruct, @PreDestroy 

C. @PreConstruct, @PostDestroy 

D. @PostConstruct, @PostDestroy, @Remove 

E. @PostConstruct, @PreDestroy, @Remove 

Answer: B 

Explanation: The Lifecycle of a Stateless Session Bean The EJB container typically creates and maintains a pool of stateless session beans, beginning the stateless session bean’s lifecycle. The container performs any dependency injection and then invokes the method annotated @PostConstruct, if it exists. The bean is now ready to have its business methods invoked by a client. 

At the end of the lifecycle, the EJB container calls the method annotated @PreDestroy, if it exists. The bean’s instance is then ready for garbage collection. 

Lifecycle of a Stateless Session Bean: 

Note: An enterprise bean goes through various stages during its lifetime, or lifecycle. Each type of enterprise bean (stateful session, stateless session, singleton session, or message-driven) has a different lifecycle. 

Reference: http://docs.oracle.com/javaee/6/tutorial/doc/giplj.html 

 

Qustion No. 4

Which two statements are correct about stateless session beans? (Choose two.) 

A. The bean class may declare instance variables. 

B. The lifetime of the bean instance is controlled by the client. 

C. The container may use the same bean instance to handle multiple business method invocations at the same time. 

D. The container may use the same bean instance to handle business method invocations requested by different clients, but not concurrently. 

Answer: AC 

Explanation: * A: Stateless session beans are EJB's version of the traditional transaction processing applications, which are executed using a procedure call. The procedure executes from beginning to end and then returns the result. Once the procedure is done, nothing about the data that was manipulated or the details of the request are remembered. There is no state. 

These restrictions don't mean that a stateless session bean can't have instance variables and therefore some kind of internal state. There's nothing that prevents you from keeping a variable that tracks the number of times a bean has been called or that tracks data for debugging. An instance variable can even hold a reference to a live resource like a URL connection for writing debugging data, verifying credit cards, or anything else that might be useful. 

C: A stateless session bean is relatively easy to develop and also very efficient. Stateless session beans require few server resources because they are neither persistent nor dedicated to one client. Because they aren't dedicated to one client, many EJB objects can use just a few instances of a stateless bean. A stateless session bean does not maintain.conversational state relative to the EJB object it is servicing, so it can be swapped freely between EJB objects. As soon as a stateless instance services a method invocation, it can be swapped to another EJB object immediately. Because there is no conversational state, a stateless session bean doesn't require passivation or activation, further reducing the overhead of swapping. In short, they are lightweight and fast! 

* The Lifecycle of a Stateless Session Bean Because a stateless session bean is never passivated, its lifecycle has only two stages: nonexistent and ready for the invocation of business methods. The EJB container typically creates and maintains a pool of stateless session beans, beginning the stateless session bean’s lifecycle. The container performs any dependency injection and then invokes the method annotated @PostConstruct, if it exists. The bean is now ready to have its business methods invoked by a client. 

At the end of the lifecycle, the EJB container calls the method annotated @PreDestroy, if it exists (not B). The bean’s instance is then ready for garbage collection. 

 

Qustion No. 5

Which two are true about the client view of a message-driven bean? (Choose two.) 

A. References to message destinations can be infected. 

B. References to message destinations cannot be looked up in the client's JNDI namespace. 

C. Clients of a message destination need to know that the destination is listened to by a pool of message consumers, 

D. Clients of a message destination do NOT need to know that the destination is listened to by a message-driven bean. 

Answer: BC 

Explanation: Client components do not locate message-driven beans and invoke methods directly on them. Instead, a client accesses a message-driven bean through, for example, JMS by sending messages to the message destination for which the message-driven bean class is the MessageListener. 

Reference: The Java EE 6 Tutorial, What is a Message-Driven Bean? 

 

Decide on Pass4sure 1Z0-895 Q&A together with download and install 1Z0-895 Q&A test out questions to get a 1Z0-895 Q&A exam qualifications. Pass4sure 1Z0-895 Q&A apply questions were created utilizing questions, in addition to highly accurate, rational together with established facts. All of our 1Z0-895 Q&A apply exam provide you with a new assessing expertise unparalleled. All of our 1Z0-895 Q&A apply test out questions together with 1Z0-895 Q&A happen to be learning from current together with busy It pros who make use of his or her knowledge in making everyone capable for the future.

To know more about the 1Z0-895, click Microsoft Dumps.