2 Replies Latest reply on Nov 4, 2008 7:37 AM by manik

    Reloading an invalidated entry

    nathanmesser

      I've been trying to setup JBoss cache to use invalidation in a cluster.

      I'm handling the re-reading of the entry from the database myself, however I'm not sure how to put the entry in the cache.

      The issue is when Cache instance A has sent out an invalidation message, and Cache instance B is now trying to access that entry, and has found it empty.

      If I use node.put, another invalidation message is sent out across the cluster.

      However if I use cache.putForExternalRead, and the node referenced by the FQN already exists, which in my case it usually does, no action is taken.

      What's the correct approach here?

      Am I using the node structure correctly? I'm using a node for each type of object, so a node will be used to store multiple objects, and each object will be read and update, and therefored invalidated, individually, not at the node level.

      Regards,
      -Nathan

        • 1. Re: Reloading an invalidated entry
          nathanmesser

          In answer to my own question, in case anyone else has similiar difficulties, it seems I was using node incorrectly.

          The API documentation states:

          A Node is a named logical grouping of data in the JBoss Cache. A node should be used to contain data for a single data record, for example information about a particular person or account.

          Once my cache was structured along these lines, putForExternalRead did what I required.

          I couldn't find this information anywhere in the User Guide. Perhaps that paragraph inserted at the start of the User API chapter would help put the rest into context.

          • 2. Re: Reloading an invalidated entry
            manik

            Good point. Thanks for letting me know.