Y seguimos con las preguntas SCBCD: setRollbackOnly

(Imagen: Paul Cézanne - El asesinato)

A session bean calls the setRollbackOnly method on the EJBContext interface within a business method with an active transaction, Which two are correct? (choose two)

  • The transaction timeout is immediately disabled
  • The container will ensure that the transaction will never commit
  • The bean must have started the current transaction for this to be legal
  • The bean must have bean-managed transaction demarcation for this to be legal
  • The bean must have container-managed transaction demarcation for this to be legal.


Un EJB con transacciones administradas por contenedor (CMT), puede usar el método setRollbackOnly del objeto EJBContext para marcar la transacción de modo que nunca se le de COMMIT.

El método setRollbackOnly procederá de esa manera si se le invoca de un método de negocio con atributos de transacción REQUIRED, REQUIRES_NEW y MANDATORY. En caso se le invoque desde métodos de negocio con atributos de transacción SUPPORTS, NOT_SUPPORTED o NEVER se lanzará la excepción java.lang.IllegalStateException.

Por lo expuesto, la respuesta es la segunda y la quinta.



Pregunta tomada de ExamWorx

Publicar un comentario