db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r385106 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/dictionary/ impl/sql/catalog/ impl/sql/conn/
Date Sat, 11 Mar 2006 16:39:53 GMT
Author: djd
Date: Sat Mar 11 08:39:53 2006
New Revision: 385106

URL: http://svn.apache.org/viewcvs?rev=385106&view=rev
Log:
DERBY-1095 (partial) Ensure DataDictionaryContexts are popped off the stack
when the connection/session is closed. Cleanup unused code of nested DataDictionaryContexts.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryContextImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=385106&r1=385105&r2=385106&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
Sat Mar 11 08:39:53 2006
@@ -179,7 +179,7 @@
 	 *
 	 * @param nested true iff this is a nested data dictionary context.
 	 */
-	DataDictionaryContext pushDataDictionaryContext(ContextManager cm, boolean nested);
+	DataDictionaryContext pushDataDictionaryContext(ContextManager cm);
 
 	/**
 	 * Clear all of the DataDictionary caches.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryContextImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryContextImpl.java?rev=385106&r1=385105&r2=385106&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryContextImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryContextImpl.java
Sat Mar 11 08:39:53 2006
@@ -43,11 +43,6 @@
 	implements DataDictionaryContext
 {
 	//
-	// True means this is a nested data dictionary. We pop a nested data dictionary
-	// when we clean up an error.
-	private final boolean nested;
-
-	//
 	// DataDictionaryContext interface
 	//
 	// we might want these to refuse to return
@@ -61,17 +56,13 @@
 
 	public void cleanupOnError(Throwable error)
 	{
-		if (!nested) return;
 		if (error instanceof StandardException)
 		{
 			StandardException se = (StandardException)error;
-		 	if (se.getSeverity() >= ExceptionSeverity.STATEMENT_SEVERITY)
-				popMe();
-		}
-		else
-		{
-			popMe();
+		 	if (se.getSeverity() < ExceptionSeverity.SESSION_SEVERITY)
+				return;
 		}
+		popMe();
 	}
 
 	//
@@ -81,14 +72,12 @@
 	// to be saved when the context
 	// is created
 	
-	DataDictionaryContextImpl(ContextManager cm, DataDictionary dataDictionary,
-									 boolean nested)
+	DataDictionaryContextImpl(ContextManager cm, DataDictionary dataDictionary)
 	{
 		super(cm, DataDictionaryContext.CONTEXT_ID);
 
 		this.dataDictionary = dataDictionary;
-		this.nested = nested;
 	}
 
-	DataDictionary			dataDictionary;
+	final DataDictionary			dataDictionary;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=385106&r1=385105&r2=385106&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Sat Mar 11 08:39:53 2006
@@ -617,7 +617,7 @@
 			SanityManager.ASSERT((cm != null), "Failed to get current ContextManager");
 
 		/* push a datadictionary context onto this stack */
-		pushDataDictionaryContext(cm, false);
+		pushDataDictionaryContext(cm);
 
 		// RESOLVE other non-StandardException errors.
 		bootingTC = null;
@@ -1157,11 +1157,10 @@
 	/**
 	 * @see DataDictionary#pushDataDictionaryContext
 	 */
-	public DataDictionaryContext pushDataDictionaryContext(ContextManager contextManager,
-														   boolean nested)
+	public DataDictionaryContext pushDataDictionaryContext(ContextManager contextManager)
 	{
 		DataDictionaryContextImpl dataDictionaryContextImpl =
-			new DataDictionaryContextImpl(contextManager, this, nested);
+			new DataDictionaryContextImpl(contextManager, this);
 
 		return dataDictionaryContextImpl;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java?rev=385106&r1=385105&r2=385106&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java
Sat Mar 11 08:39:53 2006
@@ -273,7 +273,7 @@
 
 	protected void pushDataDictionaryContext(ContextManager cm) {
 		// we make sure there is a data dictionary context in place.
-		dd.pushDataDictionaryContext(cm, false);
+		dd.pushDataDictionaryContext(cm);
 	}
 
 	/*



Mime
View raw message