You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2006/02/17 20:44:48 UTC

svn commit: r378613 - in /db/derby/code/trunk/java: client/org/apache/derby/client/net/NetXAResource.java drda/org/apache/derby/impl/drda/DRDAXAProtocol.java

Author: kmarsden
Date: Fri Feb 17 11:44:47 2006
New Revision: 378613

URL: http://svn.apache.org/viewcvs?rev=378613&view=rev
Log:
DERBY-960 Client xa prepare returns XA_OK instead of XA_RDONLY for a read only transaction

- Changed DRDAXAProtocol prepareXATransaction to return the return value of prepare in the SYNCCRD
The server was always returning XA_OK if prepare did not throw an error instead of passing the return value to the client.

For Network Client
- Changed NetXAResource() prepare to handle XA_RDONLY returned from the server. It was throwing an exception for any value returned from the server other than XA_OK.

Test was checked in by enabling checkDataSource30.java in svn  378532


Reviewed by Bryan Pendleton


Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAResource.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAResource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAResource.java?rev=378613&r1=378612&r2=378613&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAResource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAResource.java Fri Feb 17 11:44:47 2006
@@ -413,7 +413,7 @@
         } finally {
             conn_.pendingEndXACallinfoOffset_ = -1; // indicate no pending callinfo
         }
-        if (rc != XAResource.XA_OK) {
+        if ((rc != XAResource.XA_OK ) && (rc != XAResource.XA_RDONLY)) {
             throwXAException(rc, false);
         }
         if (conn_.agent_.loggingEnabled()) {

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java?rev=378613&r1=378612&r2=378613&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java Fri Feb 17 11:44:47 2006
@@ -425,7 +425,7 @@
 		int xaRetVal = xaResource.XA_OK;
 
 		try {
-			xaResource.prepare(xid);
+			xaRetVal = xaResource.prepare(xid);
 			if (SanityManager.DEBUG)
 			{
 				connThread.trace("prepared xa transaction: xaRetVal=" +