2 Replies Latest reply on Feb 10, 2004 11:41 AM by divine_comedy

    JMS and JDBC. How to recover or prevent inconsistent data ?

    divine_comedy

      I've read messages regarding the : "Prepare called on a local transaction, etc" but so far I've not found any good suggestions on how to recover or prevent inconsistent data if the scenario as detailed by Adrian on the FAQ occurs. Any takers ?

      - Can I simply do a different transaction on the JDBC commit ? and then rollback the JMS transaction ( a different one ) if the JDBC commit fails ? This is off course incovenient but I am looking for workarounds.

      Thanks

        • 1. Re: JMS and JDBC. How to recover or prevent inconsistent dat

          I recently implemented the "Last Resource Gambit" in jboss4's transaction manager.

          Perhaps you would like to download the latest jboss4 and help me test it?
          It will make it into 3.2.4 once it has been tested.

          It avoids the prepare on the local resource and rollsback the
          XA resources if the local resource fails to commit.

          JMS prepare();
          // Done after all XA resources prepare and vote ok
          JDBC commit(); -If it fails rollback XA resources

          Without a prepare on the local resource, you don't get that annoying message.
          Of course if there are two local resources you still have a problem.

          Regards,
          Adrian

          • 2. Re: JMS and JDBC. How to recover or prevent inconsistent dat
            divine_comedy

            I guess I will be able to do some simple tests, but I wouldn't have the time or inclination to port over our app to JBoss 4. I just upgraded to 3.2.3.