-
1. Re: Jboss cache does not synchronize state with DB when manu
mihai.ratiu Feb 16, 2009 9:58 AM (in response to mihai.ratiu)As an update I use Jboss Cache 1.4.0 "Cayenne" and use with EJB3EntityTreeCache Service.
-
2. Re: Jboss cache does not synchronize state with DB when manu
brian.stansberry Feb 16, 2009 5:29 PM (in response to mihai.ratiu)The cache is only aware of database changes made through your EntityManager (if you are using JPA) or Hibernate (if not).
If you add a record manually and then try to read it through the EntityManager, you'll get a database read and thereafter the entity will be cached.
What's more of a problem is if you manually update an existing database record. Then it's possible the cache will be storing out of date data, since it's unaware of the manual change. If temporarily seeing out of date data is OK, you can configure JBC eviction and add a max-age config to ensure the stale data eventually gets dropped from the cache.
But generally speaking, using a second level cache is not a great idea if an external process will be modifying the database.