db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1616299 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/execute/InsertResultSet.java testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Date Wed, 06 Aug 2014 18:41:30 GMT
Author: rhillegas
Date: Wed Aug  6 18:41:29 2014
New Revision: 1616299

URL: http://svn.apache.org/r1616299
Log:
DERBY-6692: Fix self-deadlock regression in soft-upgraded database; commit derby-6692-01-ab-withTests.diff.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=1616299&r1=1616298&r2=1616299&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
Wed Aug  6 18:41:29 2014
@@ -885,7 +885,7 @@ class InsertResultSet extends DMLWriteRe
                  throw se;
              }
  
-             if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT))
+             if ( se.getMessageId().equals(SQLState.LOCK_TIMEOUT) || se.isSelfDeadlock()
)
              {
                  // if we couldn't do this with a nested xaction, retry with
                  // parent-- we need to wait this time!

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java?rev=1616299&r1=1616298&r2=1616299&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Wed Aug  6 18:41:29 2014
@@ -385,6 +385,36 @@ public class Changes10_11 extends Upgrad
         }
     }
 
+    /** Test that identity columns handle self-deadlock in soft-upgrade mode */
+    public void test_derby6692() throws Exception
+    {
+        Connection  conn = getConnection();
+        
+        switch (getPhase())
+        {
+            case PH_CREATE:
+            case PH_SOFT_UPGRADE:
+            case PH_POST_SOFT_UPGRADE:
+            case PH_HARD_UPGRADE:
+
+                boolean originalAutoCommit = conn.getAutoCommit();
+                try
+                {
+                    conn.setAutoCommit( false );
+
+                    conn.prepareStatement( "create table t_6692(i int generated always as
identity)" ).execute();
+                    conn.prepareStatement( "insert into t_6692 values (default)" ).execute();
+
+                    conn.rollback();
+                }
+                finally
+                {
+                    conn.setAutoCommit( originalAutoCommit );
+                }
+                break;
+        }
+    }
+
     /** Test the Lucene plugin */
     public void testLuceneSupport() throws Exception
     {



Mime
View raw message