Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.5
-
None
-
None
-
Linux, JBoss-EAP-6.2, Java 7
Description
When using JTA transactions (and probably Resouce Local), a bean injecting a qualified DataSource without an EntityManager also being injected will fail with an NPE if there's no default EntityManager or won't put the correct datasource into the transaction (and fail or act inconsistently).
The reason is that in org.apache.deltaspike.jpa.impl.transaction.TransactionStrategyHelper.resolveEntityManagerQualifiers only injected EntityManagers are scanned for qualifiers used to resolve.
A workaround is to place a qualified EntityManager pointing to the same datasource. This is limited, however. Some use cases, like batch processing does not require an EntityManager and one might not be available.
Attachments
Issue Links
- contains
-
DELTASPIKE-513 Transactional interceptor throws NPE for missing EntityManager
- Closed
- duplicates
-
DELTASPIKE-513 Transactional interceptor throws NPE for missing EntityManager
- Closed