db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r513401 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/depend/ iapi/sql/dictionary/ impl/sql/ impl/sql/compile/
Date Thu, 01 Mar 2007 16:47:08 GMT
Author: djd
Date: Thu Mar  1 08:47:07 2007
New Revision: 513401

URL: http://svn.apache.org/viewvc?view=rev&rev=513401
Log:
Remove the Dependent.makeValid() call. No calls are made to makeValid() through this interface.
Can be seen by the fact that most of the implementations are empty and not covered by the
code covergae with the tests, as well as there is no path to them. The one version
that was called was for GenericPreparedStatement in CurrentOfNode, but a better method
is the rePrepare() method on PreparedStatement.
Related to DERBY-2380.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/Dependent.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/Dependent.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/Dependent.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/Dependent.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/Dependent.java Thu Mar
 1 08:47:07 2007
@@ -70,18 +70,4 @@
 	void makeInvalid(int action,
 					 LanguageConnectionContext lcc) 
 			throws StandardException;
-
-	/**
-		Attempt to revalidate the dependent. For prepared statements,
-		this could go through its dependencies and check that they
-		are up to date; if not, it would recompile the statement.
-		Any failure during this attempt should throw
-		DependencyStatementException.unableToRevalidate().
-
-		@param lcc		The LanguageConnectionContext
-
-		@exception StandardException thrown if unable to make it valid
-	 */
-	void makeValid(LanguageConnectionContext lcc) 
-		throws StandardException;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java
Thu Mar  1 08:47:07 2007
@@ -643,14 +643,6 @@
 			}
 		}
 	}
-
-	/**
-     * Attempt to revalidate the dependent. Meaningless
-	 * for constraints.
-	 */
-	public void makeValid(LanguageConnectionContext lcc) 
-	{
-	}
 	
 	/** @see TupleDescriptor#getDescriptorName */
 	public String getDescriptorName() { return constraintName; }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java
Thu Mar  1 08:47:07 2007
@@ -250,13 +250,4 @@
 				") not expected to get called");
 		}
 	}
-
-	/**
-     * Attempt to revalidate the dependent. Meaningless
-	 * for defaults.
-	 */
-	public void makeValid(LanguageConnectionContext lcc) 
-	{
-	}
-
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
Thu Mar  1 08:47:07 2007
@@ -1023,28 +1023,6 @@
 	}
 
 	/**
-     * Attempt to revalidate the dependent. For prepared statements,
-	 * this could go through its dependencies and check that they
-	 * are up to date; if not, it would recompile the statement.
-	 * Any failure during this attempt should throw
-	 * StandardException.unableToRevalidate().
-	 *
-	 * @exception StandardException thrown if unable to make it valid
-	 */
-	public final synchronized void makeValid(LanguageConnectionContext lcc) 
-		throws StandardException
-	{
-		if (valid)
-		{
-			return;
-		}
-		prepareAndRelease(lcc);
-
-		updateSYSSTATEMENTS(lcc, RECOMPILE, null);
-		
-	}
-
-	/**
 	 * Invalidate and revalidate.  The functional equivalent
 	 * of calling makeInvalid() and makeValid(), except it
 	 * is optimized.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
Thu Mar  1 08:47:07 2007
@@ -714,16 +714,6 @@
 		
 	}
 
-	/**
-     * Attempt to revalidate the dependent. Meaningless
-	 * for a trigger.
-	 *
-	 * @param 	lcc the language connection context
-	 */
-	public void makeValid(LanguageConnectionContext lcc) 
-	{
-	}
-
 
 	//////////////////////////////////////////////////////////////
 	//

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
Thu Mar  1 08:47:07 2007
@@ -362,20 +362,6 @@
 
 	}
 
-	/**
-		Attempt to revalidate the dependent. For prepared statements,
-		this could go through its dependencies and check that they
-		are up to date; if not, it would recompile the statement.
-		Any failure during this attempt should throw
-		StandardException.unableToRevalidate().
-
-		@exception StandardException thrown if unable to make it valid
-	 */
-	public void makeValid(LanguageConnectionContext lcc) 
-		throws StandardException
-	{
-	}
-
 	//
 	// class interface
 	//

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
Thu Mar  1 08:47:07 2007
@@ -206,8 +206,12 @@
 
 	public void rePrepare(LanguageConnectionContext lcc) 
 		throws StandardException {
-		if (!upToDate())
-		    makeValid(lcc);
+		if (!upToDate()) {
+			PreparedStatement ps = statement.prepare(lcc);
+
+			if (SanityManager.DEBUG)
+				SanityManager.ASSERT(ps == this, "ps != this");
+		}
 	}
 
 	/**
@@ -755,31 +759,6 @@
 				notifyAll();
 			}
 		}
-	}
-
-	/**
-		Attempt to revalidate the dependent. For prepared statements,
-		this could go through its dependencies and check that they
-		are up to date; if not, it would recompile the statement.
-		Any failure during this attempt should throw
-		StandardException.unableToRevalidate().
-
-		@exception StandardException thrown if unable to make it valid
-	 */
-	public void makeValid(LanguageConnectionContext lcc) 
-		throws StandardException 
-	{
-		PreparedStatement ps;
-
-		// REMIND: will want to go through dependency list
-		// and check if we can make it valid just on faith,
-		// i.e. when it was marked 'possibly invalid' due
-		// to a rollback or some similar action.
-
-		// this ends up calling makeValid(qt, ac) below:
-		ps = statement.prepare(lcc);
-		if (SanityManager.DEBUG)
-			SanityManager.ASSERT(ps == this, "ps != this");
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java?view=diff&rev=513401&r1=513400&r2=513401
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CurrentOfNode.java Thu
Mar  1 08:47:07 2007
@@ -169,10 +169,8 @@
 		// and create a dependency on it
 
 		preStmt = getCursorStatement();
-		if ((preStmt!=null) && (! preStmt.upToDate())) {
-			preStmt.makeValid(getLanguageConnectionContext()); // need to have the query tree
-			if (! preStmt.isValid()) // can't make it valid, say not found
-				preStmt = null;
+		if (preStmt!=null) {
+			preStmt.rePrepare(getLanguageConnectionContext());
 		}
 
 		if (preStmt == null) {



Mime
View raw message