1 Reply Latest reply on Jul 2, 2013 9:22 AM by Jonathan.Knight

    how to update the cache synchronously with the changes in database

    956039

      HI,

      I am using jpa with coherence.I configured cachestore in the cache-config.xml .After expirytime is reached, it is again loading the values from the DB. Now new value is available in the cache.

      But my idea is not to  expire values in the cache(because there are many values in the cache). Inturn if there is any update on the particular row in the db, it should automatically update in the cache.

      Is there any way to achieve the task.

        • 1. Re: how to update the cache synchronously with the changes in database
          Jonathan.Knight

          Hi

           

          Coherence cannot do this out of the box. There are various ways to do it but you need to build them yourself. it all depends on what DB you have and the functionality available on that DB. Oracle are pushing their Golden Gate product as a solution to this, although I believe you need a separate license for it. In the past I have built this sort of thing based on triggers on the DB and messaging systems (e.g. triggers and Oracle AQ messages). It is far better to not allow direct DB updates and do everything via the caches, but I know that is not always possible when integrating Coherence with legacy systems that do straight to the DB.

           

          JK