Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Non XA Driver in a distributed environment - What is the Best Practice?

 
Sanjeev Verma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guru's

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!

Thanx for reading.

Regards
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need an XA driver. Why can't you use Sybase jConnect 5.5/XA Driver.
 
Sanjeev Verma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using Sybase 11.9, which does not support XA. And lets just say the environment is not in my hands, I cannot change it on my free will .

Any ideas?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't think of some dirty hack, you will regret it.

You cannot remain on old versions of software forever, so your requirement for an XA-compliant version of Sybase should be the push to get the upgrade.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic