db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r483822 - in /db/derby/code/trunk/java: engine/org/apache/derby/diag/ engine/org/apache/derby/iapi/sql/conn/ engine/org/apache/derby/iapi/store/access/ engine/org/apache/derby/iapi/store/access/conglomerate/ engine/org/apache/derby/impl/ser...
Date Fri, 08 Dec 2006 04:28:07 GMT
Author: djd
Date: Thu Dec  7 20:28:06 2006
New Revision: 483822

URL: http://svn.apache.org/viewvc?view=rev&rev=483822
Log:
DERBY-2164 (partial) Remove AccessFactory (store) from LanguageConnectionFactory and
instead code can find the AccessFactory from the Transaction object.
The AccessFactory getAccessManager() method already existed but was not exposed
at the highest level.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/diag/LockTable.java
    db/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/TransactionController.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/Deadlock.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_Access.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/diag/LockTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/diag/LockTable.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/diag/LockTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/diag/LockTable.java Thu Dec  7 20:28:06
2006
@@ -33,7 +33,6 @@
 import org.apache.derby.iapi.error.StandardException; 
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.ConnectionUtil;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionFactory;
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.error.PublicAPI;
 
@@ -98,7 +97,6 @@
 	** private 
 	*/
 	private TransactionController tc;
-	private LanguageConnectionFactory lcf;
 	private Hashtable currentRow;		// an entry in the lock table
 	private Enumeration lockTable;	
 	private boolean wasNull;
@@ -151,8 +149,7 @@
 				LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
 
 				tc = lcc.getTransactionExecute();
-				LanguageConnectionFactory lcf = lcc.getLanguageConnectionFactory();
-				LockFactory lf = lcf.getAccessFactory().getLockFactory();
+				LockFactory lf = tc.getAccessManager().getLockFactory();
 				lockTable = lf.makeVirtualLockTable();
 				initialized = true;
 				tabInfo = new TableNameInfo(lcc, true);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/diag/TransactionTable.java Thu Dec  7
20:28:06 2006
@@ -21,12 +21,8 @@
 
 package org.apache.derby.diag;
 
-import org.apache.derby.iapi.services.monitor.Monitor;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.ConnectionUtil;
-import org.apache.derby.iapi.store.access.AccessFactory;
 import org.apache.derby.iapi.store.access.TransactionInfo;
 
 import org.apache.derby.vti.VTITemplate;
@@ -108,8 +104,8 @@
 		{
 			LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
 
-			AccessFactory af = lcc.getLanguageConnectionFactory().getAccessFactory();
-			transactionTable = af.getTransactionInfo();
+			transactionTable = lcc.getTransactionExecute().
+			   getAccessManager().getTransactionInfo();
 
 			initialized = true;
 			currentRow = -1;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionFactory.java
Thu Dec  7 20:28:06 2006
@@ -24,7 +24,6 @@
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.db.Database;
 
-import org.apache.derby.iapi.store.access.AccessFactory;
 import org.apache.derby.iapi.services.property.PropertyFactory;
 
 import org.apache.derby.iapi.sql.compile.OptimizerFactory;
@@ -34,7 +33,6 @@
 import org.apache.derby.iapi.types.DataValueFactory;
 import org.apache.derby.iapi.sql.compile.TypeCompilerFactory;
 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
-import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.Statement;
 import org.apache.derby.iapi.sql.compile.Parser;
 
@@ -48,9 +46,6 @@
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 
-import java.io.InputStream;
-
-import java.util.Locale;
 
 /**
  * Factory interface for items specific to a connection in the language system.
@@ -143,11 +138,6 @@
 		Get the PropertyFactory to use with this language connection
 	 */
 	PropertyFactory	getPropertyFactory();
-
-	/**
-		Get the AccessFactory to use with this language connection
-	 */
-	AccessFactory	getAccessFactory();
 
 	/**
 		Get the OptimizerFactory to use with this language connection

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/TransactionController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/TransactionController.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/TransactionController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/TransactionController.java
Thu Dec  7 20:28:06 2006
@@ -266,6 +266,14 @@
      * Interfaces previously defined in TcAccessIface:
      **************************************************************************
      */
+	
+    /**
+     * Get reference to access factory which started this transaction.
+     * <p>
+     *
+	 * @return The AccessFactory which started this transaction.
+     **/
+    public AccessFactory getAccessManager();
 
 	/**
 	Check whether a conglomerate exists.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/TransactionManager.java
Thu Dec  7 20:28:06 2006
@@ -112,14 +112,6 @@
     public void closeMe(SortController sort_control);
 
     /**
-     * Get reference to access factory which started this transaction.
-     * <p>
-     *
-	 * @return The AccessFactory which started this transaction.
-     **/
-    public AccessFactory getAccessManager();
-
-    /**
      * Get an Internal transaction.
      * <p>
      * Start an internal transaction.  An internal transaction is a completely

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/Deadlock.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/Deadlock.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/Deadlock.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/Deadlock.java Thu
Dec  7 20:28:06 2006
@@ -21,15 +21,11 @@
 
 package org.apache.derby.impl.services.locks;
 
-import org.apache.derby.iapi.services.locks.Lockable;
 import org.apache.derby.iapi.services.locks.VirtualLockTable;
 
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.sql.conn.LanguageConnectionFactory;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.store.access.TransactionController;
@@ -266,7 +262,7 @@
 				tc = lcc.getTransactionExecute();
 				tabInfo = new TableNameInfo(lcc, false);
 
-				tt = lcc.getLanguageConnectionFactory().getAccessFactory().getTransactionInfo();
+				tt = tc.getAccessManager().getTransactionInfo();
 
 			} catch (StandardException se) {
 				// just don't get any table info.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionFactory.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- 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
Thu Dec  7 20:28:06 2006
@@ -111,7 +111,6 @@
 	private 	JavaFactory				javaFactory;
 	private 	ClassFactory			classFactory;
 	private 	NodeFactory				nodeFactory;
-	private 	AccessFactory			af;
 	private 	PropertyFactory			pf;
 
 	private		int						nextLCCInstanceNumber;
@@ -237,14 +236,6 @@
 	}
 
 	/**
-		Get the AccessFactory to use with this language connection
-	 */
-	public AccessFactory	getAccessFactory() 
-	{
-		return af;
-	}	
-
-	/**
 		Get the PropertyFactory to use with this language connection
 	 */
 	public PropertyFactory	getPropertyFactory() 
@@ -334,8 +325,6 @@
 		//register and property validation
 		setValidation();
 
-		setStore();
-
 		ef = (ExecutionFactory) Monitor.bootServiceModule(create, this, ExecutionFactory.MODULE,
startParams);
 		of = (OptimizerFactory) Monitor.bootServiceModule(create, this, OptimizerFactory.MODULE,
startParams);
 		tcf =
@@ -453,10 +442,6 @@
 		pf = (PropertyFactory) Monitor.findServiceModule(this,
 			org.apache.derby.iapi.reference.Module.PropertyFactory);
 		pf.addPropertySetNotification(this);
-	}
-
-	protected void setStore() throws StandardException {
-		af = (AccessFactory) Monitor.findServiceModule(this,AccessFactory.MODULE);
 	}
 
     public Parser newParser(CompilerContext cc)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_Access.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_Access.java?view=diff&rev=483822&r1=483821&r2=483822
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_Access.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_Access.java
Thu Dec  7 20:28:06 2006
@@ -21,13 +21,9 @@
 
 package org.apache.derbyTesting.functionTests.util;
 
-import org.apache.derby.iapi.error.StandardException; 
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.ConnectionUtil;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionFactory;
-import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.store.access.AccessFactory;
-import org.apache.derby.iapi.error.PublicAPI;
 import java.sql.SQLException;
 
 /**
@@ -40,8 +36,7 @@
 	public static AccessFactory getAccessFactory() throws SQLException
 	{
 		LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
-		LanguageConnectionFactory lcf = lcc.getLanguageConnectionFactory();
-		return (AccessFactory)lcf.getAccessFactory();
+		return lcc.getTransactionExecute().getAccessManager();
 	}
 
 	/*



Mime
View raw message