I have 2 applications, which using the same database. The first app can write and read from database. The second app only read from database. I include second-level hibernate cache with read-write strategy. And now, when I change data from the first app, I don't see this changes at the second app. How to resolve this issue?
Asked
Active
Viewed 127 times
1 Answers
0
Disclaimer: I am not an hibernate expert, maybe somebody else can give a more cripsy answer...
This is the same question on SO: Hibernate 2nd level cache invalidation when another process modifies the database However it seems fairly outdated.
You need to look for a distributed or replicated cache and follow the documentation of the respective product. Examples:
Some blog articles about it:
If one application directly writes to the database you need to properly invalidate the second level caches by yourself.

Vlad Mihalcea
- 142,745
- 71
- 566
- 911

cruftex
- 5,545
- 2
- 20
- 36