2 Replies Latest reply on Jun 15, 2009 12:37 PM by drcallaway

    Any way to ignore cache loader exceptions?

    drcallaway

      I'm working on a caching solution that requires each server in the farm to maintain its own local cache using sticky sessions. For fault tolerance, I'd also like to asynchronously persist cached items to a JDBCCacheLoader. This way, if one of the servers fail, another server can take over for it by retrieving its information from the database. This seems to work well with the basic JDBCCacheLoader configuration as long as the database is available. However, if the database fails so does all caching operations on all web servers. To avoid having the database present a single point of failure, I'd prefer to ignore the JDBCCacheLoader exceptions (just log them) and allow the system to continue running using only the local caches. Is there a way to do this?

      Thanks!

      Dustin

        • 1. Re: Any way to ignore cache loader exceptions?
          manik

          Set async = true in your cache loader configuration?

          Also, maybe you should try asynchronous replication rather than persisting to a JDBC cache loader.

          • 2. Re: Any way to ignore cache loader exceptions?
            drcallaway

            Yes. I have set async = true but that doesn't prevent errors in the asynchronous cache loader from throwing exceptions. If the database goes down, so does the local cache. However, I was able to fix my problem by subclassing JDBCCacheLoader and catching the exceptions thrown by its public methods. This allows the local cache to remain functional even if the database becomes unavailable.

            And thanks for the asynchronous replication suggestion. That may be worth a try as well.