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 mi...@apache.org on 2010/07/21 00:28:19 UTC

svn commit: r966039 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java

Author: mikem
Date: Tue Jul 20 22:28:19 2010
New Revision: 966039

URL: http://svn.apache.org/viewvc?rev=966039&view=rev
Log:
DERBY-4735 prepare of an XA read only transaction with a declared global temporary table gets and ASSERT in SANE mode.

Fixing test case in the junit XATtest.java test.  Changed it to not try and
do an xa commit after preparing a read only transaction.  The test case still
gives an ASSERT, and in my run caused a subsequent error in the testDerby966
test, which I assume came from bad error processing of the ASSERT.

To enable test just remove the x from "public void xtestXATempTableD4735_Assert()"



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java?rev=966039&r1=966038&r2=966039&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java Tue Jul 20 22:28:19 2010
@@ -1181,7 +1181,15 @@ public class XATest extends BaseJDBCTest
             (doLoggedWorkInXact ? XAResource.XA_OK : XAResource.XA_RDONLY),
             xar.prepare(xid));
 
-        xar.commit(xid,false); 
+        if (doLoggedWorkInXact)
+        {
+            // if you don't do logged work in the transaction, then the 
+            // prepare with be done with XAResource.XA_RDONLY.  If you
+            // try to commit a prepared read only transaction you will get 
+            // an error, so only commit prepared transactions here that did
+            // some "real" logged work.
+            xar.commit(xid,false); 
+        }
 
         if (access_temp_table_after_xaendandcommit)
         {