We are using Weblogic 8.1 with sybase, and are using Sybase JConnect driver to connect to database. JConnect is a non XA compliant driver, so we are using the "Emulating Two-Phase Commit" feature that weblogic offers. It is not really much as weblogic clearly states that:
<quote> When the Emulate Two-Phase Commit for non-XA Driver option is selected (EnableTwoPhaseCommit is set to true), the non-XA JDBC resource always returns XA_OK during the XAResource.prepare() method call. The resource attempts to commit or roll back its local transaction in response to subsequent XAResource.commit() or XAResource.rollback() calls. If the resource commit or rollback fails, a heuristic error results. Application data may be left in an inconsistent state as a result of a heuristic failure. </quote>
My question is - is there a best practice to manage a distributed transaction is such a scenario. In my specific case, I have to make updates across to sybase servers, and send out a JMS message, all in one transaction. Any ideas how best to satisfy transactionality in this case while still letting the container manage majority of the work? Any pattern?
I have one idea on this. Not much, in fact quite dirty. I will share it later, don't want to pollute your minds right now!