3 Replies Latest reply on Jul 30, 2009 8:48 AM by angusm

    Pojo Cache without AOP?

      Is it possible to use Pojo Cache without AOP?
      I am using EJB3 (Entity) to access the DB.
      I tried using the Hibernate second level cache, but failed as described here:
      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=159042.
      I then tried using the PojoCache to cache the objects myself, but it failed with the same root cause as described here:
      http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3971509. (I do not know exactly which object was causing the fault. In simpler situations such as the EJB3 relationships tutorial, it worked).
      I then tried the PojoCache, but without generating the AOP for the cached classes, and it did work.

      This would be sufficient for my purposes. Could someone kindly tell me if the PojoCache without AOP is a valid approach. (JBC 1.4.1)

      Thank you.

        • 1. Re: Pojo Cache without AOP?
          hosier.david

          If I understand your question correctly, you should be able to cache anything that implements Serializable. That's how we currently do it with JBC 1.4.1...we don't use AOP at all.

          • 2. Re: Pojo Cache without AOP?

            I guess I am confused, in http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs/1.4.1.SP4/faq/en/html_single/index.html for example, I read

            PojoCache (currently implemented PojoCache as a sub-class of TreeCache) is a fine-grained field-level replicated and transactional POJO (plain old Java object) cache. By POJO, we mean that the cache: 1) automatically manages object mapping and relationship for a client under both local and replicated cache mode, 2) provides support for inheritance relationship between "aspectized" POJOs. By leveraging
            the dynamic AOP in JBossAop, it is able to map a complex object into the cache store, preserve and manage the object relationship behind the scene. During replication mode, it performs fine-granularity (i.e., on a per-field basis) update, and thus has the potential to boost cache performance and minimize network traffic.
            


            • 3. Re: Pojo Cache without AOP?

              Well, of course, the PojoCache does use AOP; that's what differentiates it from the TreeCache.
              But if you try to store an object that has not been instrumented by AOP, it will just serialize it, like the TreeCache.