I am using JOnAS as application server. I have Session Facade where the stateless session EJB performs necessary business logic and posts a message to queue for populating history information.
Now if the business method is successful everything goes on right. But if the method gives error and rollsback, second message gets posted automatically and my MDB process it second time also.
This is good! I needed a callback if business method rollsback, so that my MDB can delete relavent data (so in a way undoing the operation). I have following queries in this regard:
1. Does anyone know if according to specs second message is supposed to be fired if a business method rollsback? [I want to know if this solution is app server independant]
2. How to know which one is real message and which one is fired when business method is rolled back? [I know that its redelivered may be true, but I may not rely on that for undoing history]
If anyone has any experience in this, please reply. It will help me a lot.
Thanx in advance.