2 Replies Latest reply on Jan 22, 2008 6:32 PM by youngm

    Hibernate and OptimisticTreeCache

    youngm Novice

      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?