[jboss-user] [JBoss Cache: Core Edition] - Re: Jboss cache does not synchronize state with DB when manu

bstansberry@jboss.com do-not-reply at jboss.com
Mon Feb 16 17:29:44 EST 2009


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.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4210536#4210536

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4210536



More information about the jboss-user mailing list