db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r1476265 - in /db/derby/code/branches/10.9: ./ java/engine/org/apache/derby/impl/store/raw/xact/Xact.java java/engine/org/apache/derby/loc/messages.xml java/shared/org/apache/derby/shared/common/reference/SQLState.java
Date Fri, 26 Apr 2013 16:02:12 GMT
Author: mikem
Date: Fri Apr 26 16:02:11 2013
New Revision: 1476265

URL: http://svn.apache.org/r1476265
Log:
DERBY-4729 add more information to the XACT_PROTOCOL_VIOLATION returned from store.

backported change #1471079 from trunk to 10.9 branch.

When this error is reported it is often hard to reproduce, so adding
printing of internal state of the Transaction when it is hit.  Hopefully
this help in understanding what is going on when the error is hit.


Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
    db/derby/code/branches/10.9/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/branches/10.9/java/shared/org/apache/derby/shared/common/reference/SQLState.java

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1471079

Modified: db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=1476265&r1=1476264&r2=1476265&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
(original)
+++ db/derby/code/branches/10.9/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Fri Apr 26 16:02:11 2013
@@ -757,7 +757,8 @@ public class Xact extends RawTransaction
 		if (state == CLOSED)
         {
 			throw StandardException.newException(
-                    SQLState.XACT_PROTOCOL_VIOLATION);
+                    SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                    toInternalDetailString());
         }
 
 		if (SanityManager.DEBUG)
@@ -929,7 +930,8 @@ public class Xact extends RawTransaction
 				if (!sanityCheck_xaclosed)
                 {
 					throw StandardException.newException(
-                            SQLState.XACT_PROTOCOL_VIOLATION);
+                                    SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                                    toInternalDetailString());
                 }
 			}
 
@@ -1041,7 +1043,8 @@ public class Xact extends RawTransaction
 		if (state == CLOSED)
         {
 			throw StandardException.newException(
-                    SQLState.XACT_PROTOCOL_VIOLATION);
+                                    SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                                    toInternalDetailString());
         }
 
         // Should only be called during recovery on global transactions, 
@@ -1761,7 +1764,8 @@ public class Xact extends RawTransaction
         if (readOnly)
         {
             throw StandardException.newException(
-                SQLState.XACT_PROTOCOL_VIOLATION);
+                                    SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                                    toInternalDetailString());
         }
 
 		state = UPDATE;
@@ -1821,7 +1825,8 @@ public class Xact extends RawTransaction
         {
             // This is where we catch attempted activity on a prepared xact.
 			throw StandardException.newException(
-                    SQLState.XACT_PROTOCOL_VIOLATION);
+                                SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                                toInternalDetailString());
         }
 
 		if (SanityManager.DEBUG)
@@ -1880,7 +1885,8 @@ public class Xact extends RawTransaction
 		if (state == PREPARED || state == CLOSED)
         {
 			throw StandardException.newException(
-                    SQLState.XACT_PROTOCOL_VIOLATION);
+                    SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                    toInternalDetailString());
         }
 
 		if (SanityManager.DEBUG)
@@ -2575,7 +2581,8 @@ public class Xact extends RawTransaction
             if (state == PREPARED)
             {
                 throw StandardException.newException(
-                        SQLState.XACT_PROTOCOL_VIOLATION);
+                        SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                        toInternalDetailString());
             }
 
             prepareCommit(COMMIT_SYNC);
@@ -2587,7 +2594,8 @@ public class Xact extends RawTransaction
             if (state != PREPARED)
             {
                 throw StandardException.newException(
-                        SQLState.XACT_PROTOCOL_VIOLATION);
+                        SQLState.XACT_PROTOCOL_VIOLATION_DETAILED, 
+                        toInternalDetailString());
             }
 
             prepareCommit(COMMIT_SYNC);
@@ -2695,6 +2703,32 @@ public class Xact extends RawTransaction
         }
 	}
 
+    public String toInternalDetailString()
+    {
+
+	    return (
+            "savedEndStatus = "            + savedEndStatus         + "\n" +
+            "needSync = "                  + needSync               + "\n" +
+            "justCreated = "               + justCreated            + "\n" +
+            "myGlobalId = "                + myGlobalId             + "\n" +
+            "myId = "                      + myId                   + "\n" +
+            "state = "                     + state                  + "\n" +
+            "inComplete = "                + inComplete             + "\n" +
+            "seenUpdates = "               + seenUpdates            + "\n" +
+            "inPostCommitProcessing = "    + inPostCommitProcessing + "\n" +
+            "logStart = "                  + logStart               + "\n" +
+            "logLast = "                   + logLast                + "\n" +
+            "recoveryTransaction = "       + recoveryTransaction    + "\n" +
+            "postCompleteMode = "          + postCompleteMode       + "\n" +
+            "sanityCheck_xaclosed = "      + sanityCheck_xaclosed   + "\n" +
+            "transName = "                 + transName              + "\n" +
+            "readOnly = "                  + readOnly               + "\n" +
+            "flush_log_on_xact_end = "     + flush_log_on_xact_end  + "\n" +
+            "backupBlocked = "             + backupBlocked          + "\n" +
+            "dontWaitForLocks = "          + dontWaitForLocks       + "\n");
+    }
+
+
 	
 	/**
 	 * Get string id of the transaction that would be when the Transaction

Modified: db/derby/code/branches/10.9/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/engine/org/apache/derby/loc/messages.xml?rev=1476265&r1=1476264&r2=1476265&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/branches/10.9/java/engine/org/apache/derby/loc/messages.xml Fri Apr 26 16:02:11
2013
@@ -1083,6 +1083,12 @@ Guide.
                 <text>Operation is not supported in an internal transaction.</text>
             </msg>
 
+            <msg>
+                <name>40XT8</name>
+                <text>An internal error was identified by RawStore module. Internal
state detail from the transaction is as follows: {0}</text>
+                <arg>internalTransactionState</arg>
+            </msg>
+
         </family>
 
 

Modified: db/derby/code/branches/10.9/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1476265&r1=1476264&r2=1476265&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/branches/10.9/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Fri Apr 26 16:02:11 2013
@@ -452,6 +452,7 @@ public interface SQLState {
 	String XACT_INTERNAL_TRANSACTION_EXCEPTION                  = "40XT5";
 	String XACT_CANNOT_ACTIVATE_TRANSACTION                     = "40XT6";
 	String XACT_NOT_SUPPORTED_IN_INTERNAL_XACT                  = "40XT7";
+	String XACT_PROTOCOL_VIOLATION_DETAILED                     = "40XT8";
 
 	/*
 	** RawStore - Transactions.Basic system exceptions



Mime
View raw message