Is there a reason why you are using the HibernateTemplate. If you are using Hibernate pre 3.1 version, then the template is helpful to hide boilerplate code. If you are using 3.1 or higher it gives you no benefits at all and writing straight Hibernate/JPA code is actually better and more portable than the template.
When it comes to messaging and transactions, there is only so far the transaction can be wrapped around. So it sound like the message is already sent to a queue before the transaction has rolled back, so therefore no longer available to revert.
But you haven't posted your MDB stuff and where your transaction boundary is or its settings to help more.
Can i have the example/guide for the below
"If you are using Hibernate pre 3.1 version, then the template is helpful to hide boilerplate code. If you are using 3.1 or higher it gives you no benefits at all and writing straight Hibernate/JPA code is actually better and more portable than the template."
I don't see or understand how an EJB MDB is connected to your Spring configuration. They seem separate and therefore I see the MDB in a transaction from the JTA and App Server but not in the Spring transaction. I am missing something, or that is your problem is that they aren't connected. Also you are swallowing any exception and therefore the transaction won't rollback in the MDB.
Mark
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.