1 Reply Latest reply on Jun 29, 2004 5:32 AM by Alexey Loubyansky

    How To Explicitly (from Java) Invalidate EJB Cache?

    Daniel Wintschel Newbie

      Hi there,

      I am running into a situation where, for a certain part of our applicaiton, I need to use raw SQL in order to attain the kind of performance we need. Essentially, what this means is that I need to insert / update 120,000 rows or so in a couple different tables.

      In my case these 120,000 rows map to an Entity bean in my application, and there is a VERY good chance that most (or all) of these EJB's will already be in the JBoss EJB cache.

      What I need (would really really like to be able to do) is to execute a method (hopefully somewhere in the JBoss internals) that basically invalidates all of my Entity Bean Foo instances from the EJB cache.

      If there is a MagicJBossClass.pleaseInvalidateAllEJBsOfType( FooEJB.class ) type method, that would really really be awesome.

      Can anyone point me in the right direction, I have gone through the 'for-pay' docs, and the forums, and have not been able to find any information thus far. I am assuming I might need to use the cache-invalidation-service.xml, which I can send JMS messages to. Unfortunately, the documentation mentions absolutely nothing about the service or how to use it, except that it is disabled by default and you talk to it via JMS.

      Thanks a ton.