[jboss-user] [JBossCache] - Hibernate and OptimisticTreeCache

youngm do-not-reply at jboss.com
Thu Jan 10 17:25:03 EST 2008


I've had a JBossCache+hibernate question over on the hibernate forums for a while with no responses.  I was wondering if someone here might be able to help me out?

The question is:

Looking at the code in Hibernate OptimisticTreeCache it appears that Hibernate tells JBossCache to use an entity's version column for the cache's optimistic check when writing to the cache.

If the entity doesn't have a version column it appears hibernate tells JBossCache not to do a version check of any kind when updating the cache using a dummy DataVersion implementation. (Last update wins I presume?)

So, theoretically if I am using OptimisticeTreeCache with a Hibernate entity that don't contain a version column will my cache and DB remain synchronized? Is there any possible concurrent modification scenario where the 2 could become out of sync? For this particular Entity I don't care if concurrent changes step on each other as long as the cache and the db don't get out of sync when all is said and done.  Does anyone on this forum have any insight for me?

Thanks,
Mike

http://forum.hibernate.org/viewtopic.php?t=981936&highlight=

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

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



More information about the jboss-user mailing list