db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r480074 - in /db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn: GenericLanguageConnectionContext.java GenericStatementContext.java
Date Tue, 28 Nov 2006 14:57:36 GMT
Author: rhillegas
Date: Tue Nov 28 06:57:33 2006
New Revision: 480074

URL: http://svn.apache.org/viewvc?view=rev&rev=480074
Log:
DERBY-1732: Port fix to 10.2 branch.

Modified:
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?view=diff&rev=480074&r1=480073&r2=480074
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
(original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
Tue Nov 28 06:57:33 2006
@@ -2634,12 +2634,17 @@
 
 		/*
 		** If it isn't a StandardException, then assume
-		** xact severity.  It is probably an unexpected
+		** session severity. It is probably an unexpected
 		** java error somewhere in the language.
-		*/
+        ** Store layer treats JVM error as session severity, 
+        ** hence to be consistent and to avoid getting rawstore
+        ** protocol violation errors, we treat java errors here
+        ** to be of session severity.
+        */  
+
 		int severity = (error instanceof StandardException) ?
 			((StandardException) error).getSeverity() :
-			ExceptionSeverity.TRANSACTION_SEVERITY;
+			ExceptionSeverity.SESSION_SEVERITY;
  
 		if (statementContexts[0] != null)
 		{

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java?view=diff&rev=480074&r1=480073&r2=480074
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
(original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
Tue Nov 28 06:57:33 2006
@@ -498,12 +498,16 @@
 
 		/*
 		** If it isn't a StandardException, then assume
-		** xact severity.  It is probably an unexpected
+		** session severity.  It is probably an unexpected
 		** java error somewhere in the language.
-		*/
+        ** Store layer treats JVM error as session severity, 
+        ** hence to be consistent and to avoid getting rawstore
+        ** protocol violation errors, we treat java errors here
+        ** to be of session severity.  
+        */
 		int severity = (error instanceof StandardException) ?
 			((StandardException) error).getSeverity() :
-			ExceptionSeverity.STATEMENT_SEVERITY;
+			ExceptionSeverity.SESSION_SEVERITY;
 
 
 		/**
@@ -592,8 +596,14 @@
 	 */
 	public boolean isLastHandler(int severity)
 	{
-		return inUse && !rollbackParentContext && ((severity == ExceptionSeverity.STATEMENT_SEVERITY)
||
-						(severity == ExceptionSeverity.NO_APPLICABLE_SEVERITY));
+        // For JVM errors, severity gets mapped to 
+        // ExceptionSeverity.NO_APPLICABLE_SEVERITY
+        // in ContextManager.cleanupOnError. It is necessary to 
+        // let outer contexts take corrective action for jvm errors, so 
+        // return false as this will not be the last handler for such 
+        // errors.
+		return inUse && !rollbackParentContext && 
+            ( severity == ExceptionSeverity.STATEMENT_SEVERITY );
 	}
 
 	/**



Mime
View raw message