Free Oracle 1z0-900 Exam Questions (page: 6)

Given:

If an exception is thrown inside the if block, what effect will it have on the transaction?

  1. The transaction will be committed.
  2. The transaction will be suspended.
  3. The transaction will be rolled back.

Answer(s): C



Given the code fragments:


What code should you add to the body of the updateEmployee method in order to save pending changes to the database?

  1. entityManager.merge(emp);
  2. Context. Ctx = new InitialContext();
    UserTransaction utx = (UserTransaction)ctx.lookup(“java:comp/UserTransaction”);
    utx.begin();
    entityManager.merge(emp);
    utx.commit();
  3. entityManager.lock(emp);
    EntityManager.merge(emp);
  4. entityManager.getTransaction().begin();
    entityManager.merge(emp);
    entityManager.getTransaction().commit();

Answer(s): B



When handling a JSF request, your application code decided to redirect the call to another URL by using HTTP redirect. Which action should you take to correctly complete the handling of the JSF life cycle?

  1. Set the immediate=“true” attribute on the command button that was used to perform this call.
  2. Invoke the dispatch() method on the ExternalContext object.
  3. Invoke the setCurrentPhaseId(RENDER_RESPONSE) method on the FacesContext object.
  4. Invoke the responseComplete() method on the FacesContext object.

Answer(s): C



Given the code fragment:

When the context root is requested http://host:port/context, how does the container resolve this mapping?

  1. thirdServlet handles the request.
  2. firstServlet handles the request.
  3. The container throws an error at startup.
  4. secondServlet handles the request.

Answer(s): C



Viewing page 6 of 36



Post your Comments and Discuss Oracle 1z0-900 exam prep with other Community members:

1z0-900 Exam Discussions & Posts