1Z0-895 Exam Details

  • Exam Code
    :1Z0-895
  • Exam Name
    :Java EE 6 Enterprise JavaBeans Developer Certified Expert
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :90 Q&As
  • Last Updated
    :Dec 05, 2021

Oracle 1Z0-895 Online Questions & Answers

  • Question 1:

    A developer writes an interceptor class containing an AroundInvoke method, and applies it to the local business interface method of a stateless session bean:

    11.

    @Interceptors(FooInterceptor.class)

    12.

    public void bar() ()

    A client obtains a reference to the bean's local business interface, and calls the method bar two times from the same thread. Assuming that the container dispatches both cell to the same stateless session bean instance, how many instances

    of the FooInterceptor class will be used?

    B. 2
    C. 1
    D. Either 1 or 2

  • Question 2:

    An ejb-jar also contains three interceptor classes: AInt, BInt, CInt. Each interceptor class defines an AroundInvoke method called intercept.

    The ejb-jar also contains a stateless session bean FooBean with a local business interface Foo that declares a method foo ():

    10.

    @Stateless

    11.

    @Intercaptors ({CInt.class, BInt.class})

    12.

    public class FooBean implements Foo {

    13.

    14.

    public void foo () {}

    15.

    16.

    }

    The ejb-jar contains a META-INF/ejb-jar.xml file with an section:

    FooBean

    com.acme.AInt

    What is the interceptor order when the business methodfoo() is invoked?

    A. AInt
    B. AInt, CInt, BInt
    C. CInt, BInt, AInt
    D. AInt, BInt, CInt

  • Question 3:

    Which three methods can Bean Developer use in any EJB compliant container implementing the full Java EE6 product? (Choose three.)

    A. Class.getClassLoader
    B. FileInputStream.read
    C. DataSource.getConnection
    D. EJBContext.getCallerPrincipal
    E. Executors.newSingleThreadExecutor
    F. QueueConnection.createQueueSession

  • Question 4:

    You are writing a client that sends a message to a JMS queue. Which statement is true?

    A. You use a connection factory to create a session.
    B. When you create a session, you specify whether or not it is transacted.
    C. When you create a connection, you specify the acknowledgment mode.
    D. When you create a message producer, you must specify the name of the destination to which you will send messages.

  • Question 5:

    Given the following stateless session bean implementation classes:

    Assuming no other transaction-related metadata, what are the transaction attributes of methodA, methodB, and methodC respectively?

    A. MANDATORY, MANDATORY , and MANDATORY
    B. REQUIRED, MANDATORY, and REQUIRES_NEW
    C. MANDATORY, MANDATORY , and REQUIRES_NEW
    D. REQUIRED, REQUIRES_NEW, and REQUIRES_NEW

  • Question 6:

    A developer creates a stateful session bean that is used by many concurrent clients. The clients are written by other development team; and it is assumed that these clients might not remove the bean when ending their session. The number

    of concurrent sessions will be greater than the defined bean cache size.

    The developer must consider that the state of the session bean can be influenced by either passivation or timeout.

    Which three actions should the developer take to make the bean behave correctly in passivation and timeout situations? (Choose three.)

    A. Release references to resources in a @Remove annotated method.
    B. Re-establish references to resources in an @Init annotated method.
    C. Release references to resources in a @PreDestroy annotated method.
    D. Release references to resources in a @PrePassivate annotated method.
    E. Re-establish references to resources in a @PostActivate annotated method.

  • Question 7:

    While excepting a business method in a stateless session bean the container rolls back the method's transaction. Which three are possible causes for the container's behavior? (Choose three.)

    A. The bean uses container-managed transactions and invokes EJBContext.setRollbackOnly.
    B. The bean uses container-managed transactions and invokes EJBContext.getRollbackOnly.
    C. The business method throws a java.lang.NullPointerException.
    D. The business method throws a checked exception of a class type that is marked with the @ApplicationException annotation with the rollback element value true.
    E. The business method throws a unchecked exception of a class type that is marked with the @ApplicationException annotation with the rollback element value true.
    F. The bean uses container-managed transactions and throws a checked exception of a class type that is marked with the @ApplicationException annotation with the rollback element value false.

  • Question 8:

    Which must result in the destruction of a stateful session bean?

    A. A client calls an @Remove method and the method returns successfully.
    B. The server in which the stateful session bean was created is restarted.
    C. The stateful session bean participates in a transaction that is rolled back.
    D. The stateful session bean is chosen as a last recently used (LRU) victim for passivation.

  • Question 9:

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

    A. Once created, a timer cannot be canceled.
    B. The bean can be used within a transaction.
    C. Once created, the timer will survive a container crash.
    D. The enterprise bean must implement the TimedObject interface.
    E. The developer can use either a message-driven bean, stateless session bean, or stateful session bean.

  • Question 10:

    A developer writes a stateless session bean with one local business interface and with container- managed transactions. All 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

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-895 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.