Author: djd
Date: Thu May 17 21:07:08 2007
New Revision: 539254
URL: http://svn.apache.org/viewvc?view=rev&rev=539254
Log:
DERBY-2661 (partial) Change some callers of the ExecutionContext to get the ExecutionFactory
directly
using the language connection context. Remove the getResultSetFactory from ExecutionContext.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection.java
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/compile/DMLStatementNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.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/GenericExecutionFactory.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowUtil.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java Thu May
17 21:07:08 2007
@@ -34,7 +34,7 @@
import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
import org.apache.derby.iapi.sql.execute.ExecRow;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
+import org.apache.derby.iapi.sql.execute.ExecutionFactory;
import org.apache.derby.iapi.types.DataValueDescriptor;
import org.apache.derby.iapi.types.DataValueFactory;
@@ -128,7 +128,6 @@
long indexRows;
ConglomerateController baseCC = null;
ConglomerateController indexCC = null;
- ExecutionContext ec;
SchemaDescriptor sd;
ConstraintDescriptor constraintDesc;
@@ -140,8 +139,8 @@
dd = lcc.getDataDictionary();
dvf = lcc.getDataValueFactory();
-
- ec = lcc.getExecutionContext() ;
+
+ ExecutionFactory ef = lcc.getLanguageConnectionFactory().getExecutionFactory();
sd = dd.getSchemaDescriptor(schemaName, tc, true);
td = dd.getTableDescriptor(tableName, sd);
@@ -171,7 +170,7 @@
heapCD = td.getConglomerateDescriptor(td.getHeapConglomerateId());
/* Get a row template for the base table */
- baseRow = ec.getExecutionFactory().getValueRow(td.getNumberOfColumns());
+ baseRow = ef.getValueRow(td.getNumberOfColumns());
/* Fill the row with nulls of the correct type */
ColumnDescriptorList cdl = td.getColumnDescriptorList();
@@ -263,7 +262,7 @@
}
/* Get one row template for the index scan, and one for the fetch */
- indexRow = ec.getExecutionFactory().getValueRow(baseColumns + 1);
+ indexRow = ef.getValueRow(baseColumns + 1);
/* Fill the row with nulls of the correct type */
for (int column = 0; column < baseColumns; column++)
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java Thu May 17
21:07:08 2007
@@ -301,7 +301,7 @@
/* Get a row template for the base table */
ExecRow baseRow =
- lcc.getExecutionContext().getExecutionFactory().getValueRow(
+ lcc.getLanguageConnectionFactory().getExecutionFactory().getValueRow(
td.getNumberOfColumns());
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection.java Thu May
17 21:07:08 2007
@@ -25,9 +25,6 @@
import java.sql.SQLException;
import java.sql.SQLWarning;
-import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
-import org.apache.derby.impl.jdbc.Util;
/**
* Additional methods the embedded engine exposes on its Connection object
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=539254&r1=539253&r2=539254
==============================================================================
--- 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 21:07:08 2007
@@ -66,14 +66,6 @@
};
/**
- * Get the ResultSetFactory from this ExecutionContext.
- *
- * @return The result set factory associated with this
- * ExecutionContext
- */
- ResultSetFactory getResultSetFactory();
-
- /**
* Get the ResultSetStatisticsFactory from this ExecutionContext.
*
* @return The result set statistics factory associated with this
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java
Thu May 17 21:07:08 2007
@@ -361,12 +361,11 @@
public ResultDescription makeResultDescription()
{
- ExecutionContext ec = (ExecutionContext) getContextManager().getContext(
- ExecutionContext.CONTEXT_ID);
- ResultColumnDescriptor[] colDescs = resultSet.makeResultDescriptors(ec);
+ ResultColumnDescriptor[] colDescs = resultSet.makeResultDescriptors();
String statementType = statementToString();
- return ec.getExecutionFactory().getResultDescription(colDescs, statementType );
+ return getExecutionFactory().getResultDescription(
+ colDescs, statementType );
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java Thu
May 17 21:07:08 2007
@@ -40,8 +40,6 @@
import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
import org.apache.derby.iapi.sql.compile.CompilerContext;
import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
import org.apache.derby.iapi.sql.compile.Optimizer;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java Thu
May 17 21:07:08 2007
@@ -896,9 +896,9 @@
return this;
}
- ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)
+ ResultColumnDescriptor[] makeResultDescriptors()
{
- return childResult.makeResultDescriptors(ec);
+ return childResult.makeResultDescriptors();
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByNode.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByNode.java Thu
May 17 21:07:08 2007
@@ -131,9 +131,9 @@
}
}
- ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)
+ ResultColumnDescriptor[] makeResultDescriptors()
{
- return childResult.makeResultDescriptors(ec);
+ return childResult.makeResultDescriptors();
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
Thu May 17 21:07:08 2007
@@ -1522,23 +1522,15 @@
*
* @return A ResultDescription for this ResultSetNode.
*/
-
public ResultColumnDescriptor[] makeResultDescriptors()
{
- ExecutionContext ec = (ExecutionContext) getContextManager().getContext(
- ExecutionContext.CONTEXT_ID);
- return makeResultDescriptors(ec);
- }
-
- ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)
- {
ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()];
int size = size();
for (int index = 0; index < size; index++)
{
// the ResultColumn nodes are descriptors, so take 'em...
- colDescs[index] = ec.getExecutionFactory().getResultColumnDescriptor(((ResultColumnDescriptor)
elementAt(index)));
+ colDescs[index] = getExecutionFactory().getResultColumnDescriptor(((ResultColumnDescriptor)
elementAt(index)));
}
return colDescs;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java Thu
May 17 21:07:08 2007
@@ -910,9 +910,9 @@
return modifyAccessPaths();
}
- ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)
+ ResultColumnDescriptor[] makeResultDescriptors()
{
- return resultColumns.makeResultDescriptors(ec);
+ return resultColumns.makeResultDescriptors();
}
/*
@@ -1274,11 +1274,9 @@
public ResultDescription makeResultDescription()
{
- ExecutionContext ec = (ExecutionContext) getContextManager().getContext(
- ExecutionContext.CONTEXT_ID);
- ResultColumnDescriptor[] colDescs = makeResultDescriptors(ec);
+ ResultColumnDescriptor[] colDescs = makeResultDescriptors();
- return ec.getExecutionFactory().getResultDescription(colDescs, null );
+ return getExecutionFactory().getResultDescription(colDescs, null);
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
Thu May 17 21:07:08 2007
@@ -79,14 +79,8 @@
public abstract class BaseActivation implements CursorActivation, GeneratedByteCode
{
-
- protected ResultSetFactory rsFactory;
- protected ExecutionFactory exFactory;
- protected DataValueFactory dvFactory;
- protected LanguageConnectionContext lcc;
+ private LanguageConnectionContext lcc;
protected ContextManager cm;
- protected /*private*/ ExecutionContext ec;
-
protected ExecPreparedStatement preStmt;
protected ResultSet resultSet;
@@ -183,29 +177,6 @@
SanityManager.THROWASSERT("lcc is null in activation type " + getClass());
}
- dvFactory = lcc.getDataValueFactory();
- if (SanityManager.DEBUG)
- {
- SanityManager.ASSERT(dvFactory != null,
- "No data value factory in getDataValueFactory");
- }
-
- ec = lcc.getExecutionContext();
-
- // look for the execution context and
- // get our result set factory from it.
- rsFactory = ec.getResultSetFactory();
- if (SanityManager.DEBUG)
- {
- SanityManager.ASSERT(rsFactory!=null, "Unable to find ResultSetFactory");
- }
-
- exFactory = ec.getExecutionFactory();
- if (SanityManager.DEBUG)
- {
- SanityManager.ASSERT(exFactory!=null, "Unable to find ExecutionFactory");
- }
-
// mark in use
inUse = true;
@@ -595,15 +566,16 @@
Used in the execute method of activations for
generating the result sets that they concatenate together.
*/
- public ResultSetFactory getResultSetFactory() {
- return rsFactory;
+ public final ResultSetFactory getResultSetFactory() {
+ return getExecutionFactory().getResultSetFactory();
}
/**
Used in activations for generating rows.
*/
- public ExecutionFactory getExecutionFactory() {
- return exFactory;
+ public final ExecutionFactory getExecutionFactory() {
+ return getLanguageConnectionContext().
+ getLanguageConnectionFactory().getExecutionFactory();
}
@@ -1593,14 +1565,6 @@
}
/**
- * Get the ExecutionContext.
- */
- ExecutionContext getExecutionContext()
- {
- return ec;
- }
-
- /**
* Get the Current ContextManager.
*
* @return Current ContextManager
@@ -1616,7 +1580,7 @@
*/
public DataValueFactory getDataValueFactory()
{
- return dvFactory;
+ return getLanguageConnectionContext().getDataValueFactory();
}
/**
@@ -1627,7 +1591,7 @@
public Connection getCurrentConnection() throws SQLException {
ConnectionContext cc =
- (ConnectionContext) cm.getContext(ConnectionContext.CONTEXT_ID);
+ (ConnectionContext) getContextManager().getContext(ConnectionContext.CONTEXT_ID);
return cc.getNestedConnection(true);
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
Thu May 17 21:07:08 2007
@@ -966,7 +966,7 @@
if (compactRow == null)
{
- ExecutionFactory ex = lcc.getExecutionContext().getExecutionFactory();
+ ExecutionFactory ex = lcc.getLanguageConnectionFactory().getExecutionFactory();
if (isKeyed)
{
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=539254&r1=539253&r2=539254
==============================================================================
--- 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 21:07:08 2007
@@ -21,24 +21,16 @@
package org.apache.derby.impl.sql.execute;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
-import org.apache.derby.iapi.sql.execute.ExecutionFactory;
-import org.apache.derby.iapi.sql.execute.ResultSetFactory;
-import org.apache.derby.iapi.sql.execute.ResultSetStatisticsFactory;
-
-import org.apache.derby.iapi.sql.ResultSet;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
+import java.util.Properties;
+import org.apache.derby.iapi.error.ExceptionSeverity;
+import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.context.ContextImpl;
import org.apache.derby.iapi.services.context.ContextManager;
-
import org.apache.derby.iapi.services.monitor.Monitor;
-
-import org.apache.derby.iapi.error.StandardException;
-
-import java.util.Properties;
-import org.apache.derby.iapi.error.ExceptionSeverity;
+import org.apache.derby.iapi.sql.execute.ExecutionContext;
+import org.apache.derby.iapi.sql.execute.ExecutionFactory;
+import org.apache.derby.iapi.sql.execute.ResultSetStatisticsFactory;
/**
* ExecutionContext stores the result set factory to be used by
* the current connection, and manages execution-level connection
@@ -55,30 +47,12 @@
//
// class implementation
//
- private ResultSetFactory rsFactory;
private ResultSetStatisticsFactory rssFactory;
private ExecutionFactory execFactory;
//
// ExecutionContext interface
//
- /**
- * Get the ResultSetFactory from this ExecutionContext.
- *
- * @return The result set factory associated with this
- * ExecutionContext
- */
- public ResultSetFactory getResultSetFactory()
- {
- /* null rsFactory may have been passed to
- * constructor in order to speed up boot time.
- */
- if (rsFactory == null)
- {
- rsFactory = execFactory.getResultSetFactory();
- }
- return rsFactory;
- }
/**
* Get the ResultSetStatisticsFactory from this ExecutionContext.
@@ -136,13 +110,11 @@
// class interface
//
GenericExecutionContext(
- ResultSetFactory rsf,
ContextManager cm,
ExecutionFactory ef)
{
super(cm, ExecutionContext.CONTEXT_ID);
- rsFactory = rsf;
execFactory = ef;
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericExecutionFactory.java
Thu May 17 21:07:08 2007
@@ -159,7 +159,6 @@
* at boot time.)
*/
return new GenericExecutionContext(
- (ResultSetFactory) null,
cm, this);
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowUtil.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowUtil.java Thu May
17 21:07:08 2007
@@ -52,10 +52,7 @@
*/
public static ExecRow getEmptyValueRow(int columnCount, LanguageConnectionContext lcc)
{
- ExecutionContext ec;
-
- ec = lcc.getExecutionContext();
- return ec.getExecutionFactory().getValueRow(columnCount);
+ return lcc.getLanguageConnectionFactory().getExecutionFactory().getValueRow(columnCount);
}
/**
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java?view=diff&rev=539254&r1=539253&r2=539254
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
Thu May 17 21:07:08 2007
@@ -299,7 +299,7 @@
TransactionController.ISOLATION_SERIALIZABLE);
/* Get a row template for the base table */
- baseRow = ec.getExecutionFactory().getValueRow(td.getNumberOfColumns());
+ baseRow = lcc.getLanguageConnectionFactory().getExecutionFactory().getValueRow(td.getNumberOfColumns());
/* Fill the row with nulls of the correct type */
ColumnDescriptorList cdl = td.getColumnDescriptorList();
@@ -375,7 +375,7 @@
}
/* Get a row template */
- indexScanTemplate = ec.getExecutionFactory().getValueRow(baseColumns + 1);
+ indexScanTemplate = lcc.getLanguageConnectionFactory().getExecutionFactory().getValueRow(baseColumns
+ 1);
/* Fill the row with nulls of the correct type */
for (int column = 0; column < baseColumns; column++)
|