You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2007/05/17 18:46:15 UTC

svn commit: r539007 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/execute/ impl/sql/execute/

Author: djd
Date: Thu May 17 09:46:14 2007
New Revision: 539007

URL: http://svn.apache.org/viewvc?view=rev&rev=539007
Log:
DERBY-2661 (partial) Remove some unused and trivial methods from ExecutionContext and GenericExecutionContext.
Knock onto effect to other methods which no longer need to pass in an execution context.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecutionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecutionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecutionContext.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecutionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ExecutionContext.java Thu May 17 09:46:14 2007
@@ -91,50 +91,4 @@
 	 *		ExecutionContext
 	 */
 	ExecutionFactory getExecutionFactory();
-
-	/**
-	 * Mark the beginning of a statement (INSERT, UPDATE, DELETE)
-	 *
-	 * @param sourceRS	Source ResultSet for the statement.
-	 * @exception StandardException Thrown on error
-	 */
-	void beginStatement(ResultSet sourceRS) throws StandardException;
-
-	/**
-	 * The end of a statement (INSERT, UPDATE, DELETE)
-	 * @exception StandardException Thrown on error
-	 */
-	void endStatement() throws StandardException;
-
-	/**
-	  *	Sifts the array of foreign key constraints for the ones
-	  *	which apply in the current context. In certain contexts
-	  *	(e.g., when applying the COPY file or when tearing-off
-	  *	a new table during REFRESH), we don't want to not bother
-	  *	enforcing some foreign keys.
-	  *
-	  *	@param	fullList	the full list of foreign keys that
-	  *						apply for the current statement
-	  *
-	  *	@return	a pruned back list, which we will actually bother
-	  *			enforcing.
-	  *
-	  * @exception StandardException Thrown on error
-	  */
-	public	Object[]	siftForeignKeys( Object[] fullList ) throws StandardException;
-
-	/**
-	 * Sifts the triggers for the ones which apply in the current context. 
-	 * In certain contexts (e.g., when applying the COPY file or 
-	 * when tearing-off a new table during REFRESH), we don't want to 
-	 * not bother firing triggers.
-	 * 
-	 *	@param	triggerInfo	the original trigger info
-	 *
-	 *	@return	a pruned back triggerInfo, which we will actually bother
-	 *			enforcing.
-	 *
-	 * @exception StandardException Thrown on error
-	 */
-	public Object siftTriggers(Object triggerInfo) throws StandardException;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java Thu May 17 09:46:14 2007
@@ -107,8 +107,7 @@
 		 * which case we do the objectifying in UpdateResultSet.  Beetle 4896.  Related bug entries:
 		 * 2432, 3383.
 		 */
-		needToObjectifyStream = (this.constantAction.getTriggerInfo(
-						activation.getLanguageConnectionContext().getExecutionContext()) != null);
+		needToObjectifyStream = (this.constantAction.getTriggerInfo() != null);
 	}
 
 	public final int	modifiedRowCount() { return rowCount; }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java Thu May 17 09:46:14 2007
@@ -140,8 +140,8 @@
 
 		tc = activation.getTransactionController();
 		constants = (DeleteConstantAction) constantAction;
-		fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() );
-		triggerInfo = constants.getTriggerInfo(lcc.getExecutionContext());
+		fkInfoArray = constants.getFKInfo();
+		triggerInfo = constants.getTriggerInfo();
 		noTriggersOrFks = ((fkInfoArray == null) && (triggerInfo == null));
 		baseRowReadList = constants.getBaseRowReadList();
 		if(source != null)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionContext.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionContext.java Thu May 17 09:46:14 2007
@@ -52,8 +52,6 @@
 	extends ContextImpl 
 	implements ExecutionContext {
 
-	private ResultSet sourceRS;
-
 	//
 	// class implementation
 	//
@@ -108,47 +106,6 @@
 		return execFactory;
 	}
 
-	/**
-	 * @see ExecutionContext#beginStatement
-	 * @exception StandardException Thrown on error
-	 */
-	public void beginStatement(ResultSet sourceRS) throws StandardException {
-		this.sourceRS = sourceRS;
-	}
-
-	/**
-	 * @see ExecutionContext#endStatement
-	 * @exception StandardException Thrown on error
-	 */
-	public void endStatement() throws StandardException {
-		sourceRS = null;
-	}
-
-	/**
-	 * @see ExecutionContext#siftForeignKeys
-	 * @exception StandardException Thrown on error
-	 */
-	public	Object[]	siftForeignKeys( Object[] fullList ) throws StandardException
-	{
-		// for the Core Language, this routine is a NOP. The interesting
-		// cases occur during REFRESH and the initial boot of a Target
-		// database. See RepExecutionContext for the interesting cases.
-
-		return	fullList;
-	}
-
-	/**
-	 * @see ExecutionContext#siftTriggers
-	 * @exception StandardException Thrown on error
-	 */
-	public Object siftTriggers(Object triggerInfo) throws StandardException
-	{
-		// for the Core Language, this routine is a NOP. The interesting
-		// cases occur during REFRESH and the initial boot of a Target
-		// database. See RepExecutionContext for the interesting cases.
-		return	triggerInfo;
-	}
-
 	//
 	// Context interface
 	//
@@ -171,14 +128,6 @@
  				return;
             }
 
-
-			if (sourceRS != null)
-			{
-				sourceRS.close();
-				sourceRS = null;
-			}
-
-			endStatement();
 			return;
 		}
 	}

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?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- 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 Thu May 17 09:46:14 2007
@@ -321,8 +321,8 @@
 		heapConglom = constants.conglomId; 
 
         tc = activation.getTransactionController();
-		fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() );
-		triggerInfo = constants.getTriggerInfo(lcc.getExecutionContext());
+		fkInfoArray = constants.getFKInfo();
+		triggerInfo = constants.getTriggerInfo();
 		
 		/*
 		** If we have a before statement trigger, then

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java Thu May 17 09:46:14 2007
@@ -177,8 +177,8 @@
 		this.checkGM = checkGM;
 
 		constants = (UpdateConstantAction) constantAction;
-		fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() );
-		triggerInfo = constants.getTriggerInfo(lcc.getExecutionContext());
+		fkInfoArray = constants.getFKInfo();
+		triggerInfo = constants.getTriggerInfo();
 
 		heapConglom = constants.conglomId;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java?view=diff&rev=539007&r1=539006&r2=539007
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java Thu May 17 09:46:14 2007
@@ -174,29 +174,16 @@
 	/**
 	  *	Gets the foreign key information for this constant action.
 	  *	A full list of foreign keys was compiled into this constant
-	  *	action. However, we prune this list at run time so that we
-	  *	enforce only the foreign keys that we absolutely must.
-	  *
-	  *	What's going on here? Well, in certain contexts (REFRESH and
-	  *	when intially booting a Target), we don't have to enforce some
-	  *	foreign keys. We allow the ExecutionContext to rule on which
-	  *	foreign keys are relevant and which aren't.
+	  *	action.
 	  *
 	  *	@param	ec	the ExecutionContext
 	  *
 	  *	@return	the list of foreign keys to enforce for this action
 	  *
-	  * @exception StandardException		Thrown on failure
 	  */
-	public	FKInfo[]	getFKInfo
-	(
-		ExecutionContext	ec
-    )
-		throws StandardException
+	final FKInfo[] getFKInfo()
 	{
-		FKInfo[]	siftedArray = (FKInfo[]) ec.siftForeignKeys( fkInfo );
-
-		return siftedArray;
+		return fkInfo;
 	}
 
 	/**
@@ -204,12 +191,10 @@
 	 *
 	 * @return	the triggers that should be fired
 	 *
-	 * @exception StandardException		Thrown on failure
 	 */
-	public TriggerInfo getTriggerInfo(ExecutionContext ec) 
-		throws StandardException
+	TriggerInfo getTriggerInfo()
 	{
-		return (TriggerInfo)ec.siftTriggers(triggerInfo);
+		return triggerInfo;
 	}