1 Reply Latest reply on Feb 2, 2005 1:46 PM by ben.wang

    Should it be possible to Serialize objects take from TreeCac

    amayingenta

      Hi,
      I'm trying to implement an application session cache using TreeCacheAop. I've had some problems with Stackoverflows that have now been resolved by using JBoss-AOP 1.1, but now that I'm able to put things into the cache I'm having some problems.

      Mostly the application willl communicate internally using local ejb interfaces and the session objects will not normally be serialized, but we expect there to be some remote Java clients, and currently the test case is using a remote interface, and when it tries to retrieve a newly session it fails because it can't be serialized:

      Caused by: java.io.NotSerializableException: org.jboss.cache.aop.CachedMapInterceptor


      (the session includes various collections, including two Maps)

      I wouldn't expect the Aop cache to be aware of changes made remotely to the session object (and after modifying remotely I call a method to rebind it), but I thought it might be possible send it via a remote interface.

      As "Session" is an interface, and it's the implementation class that's been aspectized, would I be better off substituting a non-aspectized class when the cached object is serialized?

      Thanks,
      Andrew

        • 1. Re: Should it be possible to Serialize objects take from Tre

          You will need to substitue a non-aspectized class in this case. When you use Collection classes under cach aop, it returns a proxy to the Collection (in this case CacheMapInterceptor).

          But the proxy is not Serializable because it will need to access the cache store internally. So remoting won't make sense. (At least for now. :-)

          -Ben