Use of UserTransaction object inside of CDI or enterprise Beans
Issue
- How CDI Beans with
@Transactional
annotation behave if called in an EJB context? - Why it is not possible to use a
UserTransaction
object inside of a CDI bean? - Why the use of transaction inside of CDI Beans works differently after update?
-
If a CDI bean use
@Resource
to inject a UserTransaction object and it is called from an EJB there is an Exception after updating the EAP instance from version 6.4 to 7.xCaused by: javax.naming.NameNotFoundException: UserTransaction [Root exception is java.lang.IllegalStateException: WFLYEJB0137: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction]
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7
- 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.