3 Replies Latest reply on Jan 27, 2006 10:14 AM by hmesha

    How to do this with JBOSS cache

    bertin

      I have an appserver with stateless beans. The application uses some sort of metadata that defines the behaviour of the application, this metadata is cached.
      Part of this metadata can be altered by the user and only these user setting are stored in the metadata. Changing the metadata takes some time (hours) and a lot of calls to the appserver but the application should still be up and running for other users. On the other hand, the cache is also needed to verify while changing.

        • 1. Re: How to do this with JBOSS cache
          hmesha

          Lets first map what you're describing to JBoss Cache terminology. The stateless beans holds the business logic that interact wth the metadata that can be cache nodes within a tree. The user can alter those nodes specifically the user settings which can be stored as attributes of the nodes.

          That's as far as I understand from your post. Can you provide more details for:


          Changing the metadata takes some time (hours) and a lot of calls to the appserver but the application should still be up and running for other users. On the other hand, the cache is also needed to verify while changing.


          so I can better answer you specific needs.

          Cheers,

          Hany

          • 2. Re: How to do this with JBOSS cache
            bertin

            Changing the metadata takes some time (hours) and a lot of calls to the appserver but the application should still be up and running for other users. On the other hand, the cache is also needed to verify while changing.

            Changing the metadata is done manually by an end-user (application manager). Het can change workflow settings, apply rules to data that is entered etc. So in fact the metadata that is being changed is for some time not complete and ready for use. At a given point the application manager completes his work and marks the metadata ready for use.

            The other users that are working with business data that depend on the old version of the metadata until the moment that the application manager marks the new metadata ready for use.

            • 3. Re: How to do this with JBOSS cache
              hmesha

              It looks like you want the cache to service the users with the original metadata while the other user continue working with the workflow. When the workflow user commit the work then the cache gets updated with the new metadata. that should be doable.

              Your cache can load data from a data source that the workflow engine commit the changes to and order the cache to reload data. This way, the data in the cache will continue serve the users with the original metadata until the workflow commits.

              In JBossCache terms you configure the cache tree with a cache loader that connects to the data source. When the data is not in the cache, the cache loader will load it from the datasource. When the workflow user commit the data, It'll remove the updated data from the cache so the next time the data is requested by a user, the cache loader will attempt to load it from the data source.

              Hope this answers your question.

              Cheers,

              Hany