JPA and JPA Binding don't share the same persistence context in FSW 6
Issue
- JPA and Camel JPA (JPA binding) use different transaction scopes even when running in the same transaction, meaning that there are two first level caches for the same transaction, possibly holding different versions of the same entity.
- This is not what developers expect and could lead to hard to diagnose problems.
- The cause of this seems to be that the Spring version used by Camel JPA uses its own transaction scoping mechanism and not the one provided by Java EE.
- It is a serious issue if there can be multiple transaction scoped entity managers/persistence contexts associated with a single transaction.
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.0.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
