[jboss-user] [JBossMQ] - Re: HeuristicMixed Exception (javax.jms.IllegalStateExceptio

jhowell@redhat.com do-not-reply at jboss.com
Fri Oct 3 15:41:58 EDT 2008


Ok, So you were getting errors with the new tx manager that said "WARN Adding multiple last resources is disallowed. Current resource is ".  So you moved back to old deprecated tx manager so you could enlist multiple 1phase commit resources.  Am I right so far?  You may have even changed the settings in arjuna for com.arjuna.ats.jta.allowMultipleLastResources.  

The problem is that you have multiple 1phase commit resources.  The reason it's called a last resource, is because the 1pc resource should be the last resource being committed, because it can't be rolled back.  Remember this is a 1 phase commit object, not a prepare and a commit.  If you commit multiple 1pc resources in your tx, then you can only throw an exception out of the last 1pc resource.  You can't roll the other 1pc resources back that have already committed.  Does that make sense so far.  When you try to roll back 1pc resoruces that have already been committed, you get a heuristic exception, which means that all the 2pc resources have been rolled back, but the 1pc resources were not able to.  So you have some part of your tx that was committed and some part that wasn't.  


So the answer is to change things to use 2PC or to separate your resources into separate transactions.   The easiest thing is to change your Datasource to be an XA datasource and don't use other 1PC resources in your transactions.  

The issue is not really mq.  What is happening is normal.  When something happens with mq, it will roll the transaction back.  Since some 1pc resoruces have been committed already, it can't rollback and you get a heuristic exception.

I think you have a fairly big anti-pattern also.  Your tx is way to long.  A 2 hour long running transaction is not a good thing to have.  You should find a different way.  A 2 hour long running transaction tells me there is a design problem.

Jay:)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180360#4180360

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180360



More information about the jboss-user mailing list