3 Replies Latest reply on Jul 5, 2011 12:58 PM by Pete Muir

    Infinispan Cache

    vinod mehta Newbie

      Hi All,


      Can anybody tell me that is there any way for


      1. Is there any way if change in database then that change will reflect in infinispan Cache?


      Thanks In Advance  !!!!

        • 1. Re: Infinispan Cache
          Pete Muir Master

          It depends on your exact set up I think. Are you using Infinispan as the 2nd level cache for Hibernate?


          Assuming you do all your database work through an ORM like Hibernate, then you could use an EntityListener to listen for updates to the database, and use that to evict entries from the cache that are now invalid. However, I'm not sure how well this will scale. In general it's better to determine an expiration for items in the cache that your business requirements will allow for.

          • 2. Re: Infinispan Cache
            vinod mehta Newbie

            Hi Pete,


            No right now i am not using hibernate /CACHE 2only access the data and insert the database in to infinispan cache and do operation here i can update the database by using time interval to update database but i dont know how to update the infinispan cache if the database update by physically or web service.


            How the Database reflect in infinispan.when Database update by Physically / any web service/Directly ?


            Thanks For Reply


            • 3. Re: Infinispan Cache
              Pete Muir Master

              AIUI your architecture you need to write a manual hook that can remove entries from the cache as needed.