Reputation: 1
I have two server applications with the same database
.
I created the persistence for each application. They connect to the same database
.
The problem is that the application 1 cannot see the data that's committed by application 2 sometimes (in the query (em.createQuery
)).
I found a solution for this problem by closing and reopening the EntityManager
before creating the query.
Is there an easier solution in JPA?
Upvotes: 0
Views: 111
Reputation: 16060
If you have a second-level cache enabled and one em can't see the cached data of the second em
solutions:
EJB-application
as db-layer and use Beans to communicate with your DBUpvotes: 1