3 Replies Latest reply on Nov 17, 2005 12:29 AM by ben.wang

    How to load objects through CacheLoader for TreeCacheAop?

    Satish Yellanki Newbie


      We currently use TreeCache to do local caching of some database objects. We created our own CacheLoader which will load/save the objects from the database as needed. The code to load the object from the database is added in the get(Fqn) method of the CacheLoader which returns the Map of all the attributes of the object. All this works fine.

      Now, we are trying to move to the TreeCacheAop which should make our code cleaner as we can directly operate on the objects and not worry about updating the attributes in the cache. However, we are unable to figure out where in the code path the putObject(Object) should be executed to attach the object to the cache. Our initial reaction was to load the object from the database as part of the get(Fqn) method in the CacheLoader and attach it to the cache using putObject method. If this is correct, what should be returned in the Map? Any help is very much appreciated.

      On a side note, I was looking at the CacheLoaderAop interface, but that doesn't seem to be used anywhere in the code. Any docs/examples on usage of this?