Closed glassfishrobot closed 11 years ago
Reported by abien
mvatkina said: I'm not sure how to close this issue. But the CMT transactions are being discussed at the platform level, so the work is done there.
mvatkina said: reopening to close properly
mvatkina said: Duplicate of http://java.net/jira/browse/JTA_SPEC-5
Was assigned to mvatkina
This issue was imported from java.net JIRA EJB_SPEC-8
Marked as duplicate on Tuesday, December 4th 2012, 2:01:03 pm
Currently the EJB @TransactionAttribute annotation can only be used with the EJB component model. With the introduction of managed beans and CDI, there are not many good technical reasons why the @TransactionAttribute annotation should not be used in managed beans as well. In fact, many developers that are wary of the EJB component model would opt to use this model instead. In addition, decoupling EJB services such as @TransactionAttribute from the component model moves towards removing one-off component models in Java EE in favor of unifying around managed beans/CDI.
You should be able to do something like:
@TransactionAttribute(RequiresNew) @RequestScoped public class OrderService{ ...
public void store()
{...}
}
Currently transactions are re-invented in various projects with custom interceptor bindings like @Transactional in CDI.