[jboss-user] [JBossCache] - Re: Hibernate/Cache conceptual mismatch

steve.ebersole@jboss.com do-not-reply at jboss.com
Wed Oct 11 10:37:42 EDT 2006


Just to clarify my last comment.  Keep in mind that putFromExternalRead() always results from the following usage pattern:

Object state = readFromCache();
if ( state == null ) {
    state = readFromExternal();
    putIntoCache( state );
}
...

In Hibernate terms, readFromExternal is causing the data to get read from the database because it was not found in the cache.  That db-read data is always the "truth" in a db-driven app...

The only way that data should not overwrite the current node data (putIntoCache) is if suddenly there has been a write lock applied to the node between readFromCache() and putIntoCache() being executed (which is the meaning of my "intention lock" comment).

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

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



More information about the jboss-user mailing list