3 Replies Latest reply on Nov 21, 2003 2:15 AM by Julien Dubois

    EntityBeans with cache invalidation not working?

    Julien Dubois Newbie

      Hi everybody,

      I spent most of the day reading this forum and googling, but I didn't find any answer to my current problem.

      So I hope you'll be able to help me!

      I am trying to make my Entity beans work as in this wonderful paper :
      http://www.onjava.com/pub/a/onjava/2003/05/28/jboss_optimization.html

      But I can't make the cache work.
      If I update the database directly, the changes are shown straight away in my web pages.

      If I extend "Standard CMP 2.x EntityBean", and use commit option A, everything is fine.

      But if I use "Standard CMP 2.x EntityBean with cache invalidation", the cache is not working anymore.
      So I tried to force it to use commit option A :

      <container-configurations>
      <container-configuration extends="Standard CMP 2.x EntityBean with cache invalidation">
      <container-name>ICF CMP 2.x EntityBean</container-name>
      <commit-option>A</commit-option>
      </container-configuration>
      </container-configurations>

      No luck, doesn't work at all...
      So my farm of servers is working ok, but without any cache (aka commit option B), so my perf is very very bad.

      Can somebody help me?

      Julien Dubois.

        • 1. Re: EntityBeans with cache invalidation not working?
          Julien Dubois Newbie

          Hi,

          As nobody answered me I had to find the answer all by myself...
          I was using the XDoclet @ejb-transaction tag on every method, which was set 95% of the time to "Supports". This is the default (according to the XDoclet doco), so I thought it was ok.
          But after erasing those tags, I had the cache (and invalidation service) working!!
          Warning warning warning : if you're using the cache invalidation service like me, do not use the transactions at the method level. I suspect that it invalidates the cache at every request : as the distributable cache is not transactional, it is understandable, but as I was using the default "Supports" option, this is clearly a weird result from the JBoss server.
          BTW, no transaction was started, so the "Supports" option should not have caused the invalidation of the cache.

          HTH,

          Julien Dubois.

          • 2. Re: EntityBeans with cache invalidation not working?
            john.roome Newbie

            Hi Julien.
            I'm sorry that I couldn't help with your problem using the cache invalidation, perhaps you could help me with one I'm having.
            I've got two nodes running in the same partition, both using the out of the box "Standard CMP 2.x EntityBean with cache invalidation" configuration. Unfortunately whenever I try to access any EJBs I get a deadlock and transaction rollback. I'm not setting any method level transaction attributes. I was wondering if you have seen this before?

            cheers

            John

            Configuration Details
            JBoss 3.2.2 on Windows/Linux/Solaris
            PostGres db

            • 3. Re: EntityBeans with cache invalidation not working?
              Julien Dubois Newbie

              Hi John,

              Concerning the transactions, I'm just using the "Supports" option at the class level.
              I'm also using Oracle9i with their latest drivers. I guess Postgresql is having decent drivers, but there could be an issue here.

              Could you post your EJB configuration? And could you post an example of how you access your EJBs?

              Julien.