I have deployed my own tree cache in the jboss. In this cache an object id is written. After the persist of the object the id should be removed from cache.
I'm using container managed transactions (the transaction is committed after the method call is finished). To be sure the id is removed after the transaction is finished , I can?t remove it in the method where the object is persisted via the entity manager.
Now I need something like a notification or a method which is executed after a transaction is committed.
I have written a MDB which uses a transactional queue. I think this will solve my problem.
Is there a better (with consideration of the performance) way to do it?