1 Reply Latest reply on Jan 24, 2006 10:44 AM by manik

    TreeCache._replicate() to pass method calls up the intercept

    manik

      Background

      Prior to JBossCache 1.3, replications occured by calling the _replicate() method on remote caches, which then called the replicate() method of the replication interceptor of it's chain.

      I changed this in HEAD to pass the call up the interceptor chain from the start, so that all transactional work including setting up local transactions for corresponding global transactions could be handled in a single TxInterceptor at the start of the chain.

      Cache store interceptor

      This mechanism started causing problems with the cache store interceptor in that when using a shared cache loader, the cache store interceptor had no idea whether the origin of the method call was local or remote so the cache was persisted multiple times into the same cache loader, once for each TreeCache used.

      Workaround

      This problem has been fixed by the CacheStoreInterceptor ignoring invocations (simply passing up the interceptor chain) if the TreeCache.ActionOrigin associated with the thread is set to remote and the cache loader is shared. This way only the cache where the replication originates has responsibility to persist the cache contents when using a shared cache loader.