File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Non XA Driver in a distributed environment - What is the Best Practice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Non XA Driver in a distributed environment - What is the Best Practice?" Watch "Non XA Driver in a distributed environment - What is the Best Practice?" New topic
Author

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

Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
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

Joined: Sep 29, 2002
Posts: 1683
You need an XA driver. Why can't you use Sybase jConnect 5.5/XA Driver.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
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

Joined: Sep 29, 2002
Posts: 1683
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Non XA Driver in a distributed environment - What is the Best Practice?
 
Similar Threads
Distributed Transactions
transaction when multiple database connections are open
Performance - XA Vs Non XA
XA vs NON XA drivers
releasing connection in CMT