db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1200232 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/sql/dictionary/ engine/org/apache/derby/impl/sql/catalog/ storeless/org/apache/derby/impl/storeless/
Date Thu, 10 Nov 2011 09:16:55 GMT
Author: kahatlen
Date: Thu Nov 10 09:16:55 2011
New Revision: 1200232

URL: http://svn.apache.org/viewvc?rev=1200232&view=rev
Log:
DERBY-4845: Improve the dependency tracking for our build targets

Don't access the readOnlyUpgrade field in DataDictionaryImpl directly
from iapi code. Added a method to the DataDictionary interface instead.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.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/catalog/SYSSTATEMENTSRowFactory.java
    db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=1200232&r1=1200231&r2=1200232&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
Thu Nov 10 09:16:55 2011
@@ -1871,6 +1871,16 @@ public interface DataDictionary
 		@return True if the database has been upgraded to the required level, false otherwise.
 	*/
 	public boolean checkVersion(int majorVersion, String feature) throws StandardException;
+
+    /**
+     * Check if the database is read only and requires some form of upgrade
+     * that makes the stored prepared statements invalid.
+     *
+     * @return {@code true} if the stored prepared statements are invalid
+     * because of an upgrade and the database is read only, {@code false}
+     * otherwise
+     */
+    public boolean isReadOnlyUpgrade();
 	
     /**
      * Add or remove a permission to the permission database.

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?rev=1200232&r1=1200231&r2=1200232&view=diff
==============================================================================
--- 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 Nov 10 09:16:55 2011
@@ -393,7 +393,7 @@ public class SPSDescriptor extends Tuple
 		setCompileTime();
 		setParams(preparedStatement.getParameterTypes());
 
-		if (!((org.apache.derby.impl.sql.catalog.DataDictionaryImpl) dd).readOnlyUpgrade) {
+		if (!dd.isReadOnlyUpgrade()) {
 
 			/*
 			** Indicate that we are going to write the data
@@ -689,7 +689,7 @@ public class SPSDescriptor extends Tuple
 			
 
 
-			if (!((org.apache.derby.impl.sql.catalog.DataDictionaryImpl) (lcc.getDataDictionary())).readOnlyUpgrade)
{
+			if (!lcc.getDataDictionary().isReadOnlyUpgrade()) {
 
 				//bug 4821 - First try compiling on a nested transaction so we can release
 				//the locks after the compilation. But if we get lock time out on the
@@ -1100,7 +1100,7 @@ public class SPSDescriptor extends Tuple
 
 		DataDictionary dd = getDataDictionary();
 
-		if (((org.apache.derby.impl.sql.catalog.DataDictionaryImpl) dd).readOnlyUpgrade)
+		if (dd.isReadOnlyUpgrade())
 			return;
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java?rev=1200232&r1=1200231&r2=1200232&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java Thu
Nov 10 09:16:55 2011
@@ -555,7 +555,7 @@ public	class DD_Version implements	Forma
 			// invalidate all the procedures we need to indicate that
 			// any procedure we read off disk is automatically invalid,
 			// so we do not try to load the generated class.
-			bootingDictionary.readOnlyUpgrade = true;
+			bootingDictionary.setReadOnlyUpgrade();
 		}
 
 		bootingDictionary.clearCaches();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1200232&r1=1200231&r2=1200232&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
Thu Nov 10 09:16:55 2011
@@ -428,7 +428,8 @@ public final class	DataDictionaryImpl
 		that created it.
 
 	*/
-	public boolean readOnlyUpgrade;
+	private boolean readOnlyUpgrade;
+
     /**
      * Tells if the automatic index statistics refresher has been disabled.
      * <p>
@@ -10486,7 +10487,19 @@ public final class	DataDictionaryImpl
 
 		return dictionaryVersion.checkVersion(requiredMajorVersion, feature);
 	}
-		
+
+    public boolean isReadOnlyUpgrade() {
+        return readOnlyUpgrade;
+    }
+
+    /**
+     * Mark this database as a read only database whose stored prepared
+     * statements are invalid because some kind of upgrade is needed.
+     */
+    void setReadOnlyUpgrade() {
+        readOnlyUpgrade = true;
+    }
+
 	/**
 	** Create system built-in metadata stored prepared statements.
 	*/

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java?rev=1200232&r1=1200231&r2=1200232&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
Thu Nov 10 09:16:55 2011
@@ -307,7 +307,7 @@ public class SYSSTATEMENTSRowFactory ext
 
 		// In soft upgrade mode the plan may not be understand by this engine
 		// so force a recompile.
-		if (((DataDictionaryImpl) dd).readOnlyUpgrade) {
+		if (dd.isReadOnlyUpgrade()) {
 			valid = false;
 		} else {
 			// 5th column is VALID (boolean)

Modified: db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java?rev=1200232&r1=1200231&r2=1200232&view=diff
==============================================================================
--- db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
(original)
+++ db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
Thu Nov 10 09:16:55 2011
@@ -775,6 +775,10 @@ public class EmptyDictionary implements 
 		return false;
 	}
 
+    public boolean isReadOnlyUpgrade() {
+        return false;
+    }
+
 	public boolean addRemovePermissionsDescriptor(boolean add,
 			PermissionsDescriptor perm, String grantee, TransactionController tc)
 			throws StandardException {



Mime
View raw message