db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1179717 [1/2] - in /db/derby/code/branches/10.8: java/engine/org/apache/derby/catalog/ java/engine/org/apache/derby/iapi/reference/ java/engine/org/apache/derby/iapi/sql/dictionary/ java/engine/org/apache/derby/impl/db/ java/engine/org/apa...
Date Thu, 06 Oct 2011 17:36:42 GMT
Author: rhillegas
Date: Thu Oct  6 17:36:41 2011
New Revision: 1179717

URL: http://svn.apache.org/viewvc?rev=1179717&view=rev
Log:
DERBY-5448: Back out 10.8 version of concurrency improvements to identity columns.

Removed:
    db/derby/code/branches/10.8/java/engine/org/apache/derby/catalog/SequencePreallocator.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceRange.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/t_4437_2.dat
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_8_2.java
Modified:
    db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/reference/Property.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/db/BasicDatabase.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/CreateSequenceNode.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_de_DE.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_es.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_fr.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_it.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ja_JP.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ko_KR.properties
    db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_zh_TW.properties
    db/derby/code/branches/10.8/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/branches/10.8/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AutoIncrementTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceGeneratorTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
    db/derby/code/branches/10.8/tools/javadoc/publishedapi.ant

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/reference/Property.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/reference/Property.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/reference/Property.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/reference/Property.java Thu Oct  6 17:36:41 2011
@@ -627,24 +627,6 @@ public interface Property { 
 	int		LANG_SEQGEN_CACHE_SIZE_DEFAULT =32;
 
 	/**
-	 * The size of the identity generator cache 
-	 * used by the data dictionary.  Database.  Static.
-	 * <p>
-	 * Externally visible.
-	 */
-	String	LANG_IDGEN_CACHE_SIZE = "derby.language.identityGeneratorCacheSize";
-	int		LANG_IDGEN_CACHE_SIZE_DEFAULT =32;
-
-	/**
-	 * Name of the implementation of SequencePreallocator which is used
-     * to tune how many values Derby pre-allocates for identity columns
-     * and sequences. Database.  Static.
-	 * <p>
-	 * Externally visible.
-	 */
-	String	LANG_SEQUENCE_PREALLOCATOR = "derby.language.sequence.preallocator";
-    
-	/**
 	  derby.language.stalePlanCheckInterval
 
 	  <P>

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java Thu Oct  6 17:36:41 2011
@@ -214,13 +214,6 @@ public interface DataDictionary
 	public void clearCaches() throws StandardException;
 
 	/**
-	 * Clear all of the sequence number generators.
-	 *
-	 * @exception StandardException Standard Derby error policy
-	 */
-	public void clearSequenceCaches() throws StandardException;
-
-	/**
 	 * Inform this DataDictionary that we are about to start reading it.  This
 	 * means using the various get methods in the DataDictionary.
 	 * Generally, this is done during query compilation.
@@ -1722,6 +1715,29 @@ public interface DataDictionary
 		throws StandardException;
 
 	/**
+	 * getSetAutoincrementValue fetches the autoincrement value from 
+	 * SYSCOLUMNS given a row location. If doUpdate is true it updates
+	 * the autoincrement column with the new value.
+	 * the value returned by this routine is the new value and *NOT* the
+	 * value in the system catalogs.
+	 * 
+	 * @param rl		RowLocation of the entry in SYSCOLUMNS.
+	 * @param tc		TransactionController to use.
+	 * @param doUpdate  Write the new value to disk if TRUE.
+	 * @param newValue	A NumberDataValue to use to return incremented value. If
+	 * null, then the caller simply wants the current value fromd disk.
+	 * @param wait		If true, then the caller wants to wait for locks. When
+	 * using a nested user xaction we want to timeout right away if the parent
+	 * holds the lock.
+	 */
+	public NumberDataValue 	getSetAutoincrementValue(RowLocation rl,
+											 TransactionController tc,
+											 boolean doUpdate,
+											 NumberDataValue newValue,
+											 boolean wait)
+		throws StandardException;
+
+	/**
 	 * sets a new value in SYSCOLUMNS for a particular
 	 * autoincrement column.
 	 * 
@@ -1740,22 +1756,21 @@ public interface DataDictionary
 		throws StandardException;
 	
 	/**
-	 * Get the next number from an identity or sequence generator
-     * which was created with the CREATE TABLE or CREATE SEQUENCE statement. May
-     * raise an exception if the generator was defined as NO CYCLE and
-     * the range of the generator is exhausted. May allocate a range of
-     * numbers and update the current column of the
-     * corresponding row in SYSCOLULMNS or SYSSEQUENCES. This work is done in the
+	 * Get the next number from an ANSI/ISO sequence generator
+     * which was created with the CREATE SEQUENCE statement. May
+     * raise an exception if the sequence was defined as NO CYCLE and
+     * the range of the sequence is exhausted. May allocate a range of
+     * sequence numbers and update the CURRENTVALUE column of the
+     * corresponding row in SYSSEQUENCES. This work is done in the
      * execution transaction of the current session.
 	 * 
-	 * @param catalogNumber Number of the catalog that manages the values (either SYSCOLUMNS_CATALOG_NUM or SYSSEQUENCES_CATALOG_NUM)
-	 * @param uuidString String value of the UUID which identifies the table or the sequence
-	 * @param returnValue This is a data value to be stuffed with the next number in the range.
+	 * @param sequenceUUIDstring String value of the UUID which identifies the sequence
+	 * @param returnValue This is a data value to be stuffed with the next sequence number.
      *
-     * @throws StandardException if the generator does not cycle and its range is exhausted
+     * @throws StandardException if the sequence does not cycle and its range is exhausted
 	 */
     public void getCurrentValueAndAdvance
-        ( int catalogNumber, String uuidString, NumberDataValue returnValue )
+        ( String sequenceUUIDstring, NumberDataValue returnValue )
         throws StandardException;
 
 	/**

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java Thu Oct  6 17:36:41 2011
@@ -32,7 +32,6 @@ import org.apache.derby.iapi.sql.depend.
 import org.apache.derby.iapi.sql.depend.Dependent;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.impl.sql.catalog.DDdependableFinder;
 
@@ -46,9 +45,6 @@ import org.apache.derby.impl.sql.catalog
 public class SequenceDescriptor extends TupleDescriptor
         implements Provider, Dependent, PrivilegedSQLObject
 {
-    // indexes into array of computed min/max values
-    public  static  final   int MIN_VALUE = 0;
-    public  static  final   int MAX_VALUE = MIN_VALUE + 1;
 
     private UUID sequenceUUID;
     private String sequenceName;
@@ -94,35 +90,6 @@ public class SequenceDescriptor extends 
         this.canCycle = canCycle;
     }
 
-    /**
-     * Compute the minimum and maximum values for a sequence range.
-     * Returns an array of two Longs. The first Long is the minimum value,
-     * The second is the maximum value.
-     */
-    public  static  Long[]  computeMinMax
-        (
-         DataTypeDescriptor dataType,
-         Object minValue,
-         Object maxValue
-         )
-    {
-        Long[]  retval = new Long[ 2 ];
-
-        if (dataType.getTypeId().equals(TypeId.SMALLINT_ID)) {
-            retval[ MIN_VALUE ] = (minValue != null ? (Long) minValue : new Long(Short.MIN_VALUE));
-            retval[ MAX_VALUE ] = (maxValue != null ? (Long) maxValue : new Long(Short.MAX_VALUE));
-        } else if (dataType.getTypeId().equals(TypeId.INTEGER_ID)) {
-            retval[ MIN_VALUE ]  = (minValue != null ? (Long) minValue : new Long(Integer.MIN_VALUE));
-            retval[ MAX_VALUE ]  = (maxValue != null ? (Long) maxValue : new Long(Integer.MAX_VALUE));
-        } else {
-            // Could only be BIGINT
-            retval[ MIN_VALUE ]  = (minValue != null ? (Long) minValue : new Long(Long.MIN_VALUE));
-            retval[ MAX_VALUE ]  = (maxValue != null ? (Long) maxValue : new Long(Long.MAX_VALUE));
-        }
-
-        return retval;
-    }
-
    /**
 	 * @see UniqueTupleDescriptor#getUUID
 	 */

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/db/BasicDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/db/BasicDatabase.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/db/BasicDatabase.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/db/BasicDatabase.java Thu Oct  6 17:36:41 2011
@@ -241,17 +241,6 @@ public class BasicDatabase implements Mo
     }
 
 	public void stop() {
-        // The data dictionary is not available if this database has the
-        // role as an active replication slave database.
-        if (dd != null) {
-            try {
-                // on orderly shutdown, try not to leak unused numbers from
-                // the sequence generators.
-                dd.clearSequenceCaches();
-            } catch (StandardException se) {
-                se.printStackTrace(Monitor.getStream().getPrintWriter());
-            }
-        }
 		active = false;
 	}
 

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java Thu Oct  6 17:36:41 2011
@@ -385,13 +385,11 @@ public final class	DataDictionaryImpl
 	CacheManager	nameTdCache;
 	private CacheManager	spsNameCache;
     private CacheManager sequenceGeneratorCache;
-    private CacheManager idGeneratorCache;
 	private Hashtable		spsIdHash;
 	// private Hashtable       spsTextHash;
 	int				tdCacheSize;
 	int				stmtCacheSize;
     private int seqgenCacheSize;
-    private int idgenCacheSize;
 
     /* Cache of permissions data */
     CacheManager permissionsCache;
@@ -635,10 +633,6 @@ public final class	DataDictionaryImpl
 		seqgenCacheSize = PropertyUtil.intPropertyValue(Property.LANG_SEQGEN_CACHE_SIZE, value,
 									   0, Integer.MAX_VALUE, Property.LANG_SEQGEN_CACHE_SIZE_DEFAULT);
 
-		value = startParams.getProperty(Property.LANG_IDGEN_CACHE_SIZE);
-		idgenCacheSize = PropertyUtil.intPropertyValue(Property.LANG_IDGEN_CACHE_SIZE, value,
-									   0, Integer.MAX_VALUE, Property.LANG_IDGEN_CACHE_SIZE_DEFAULT);
-
 		value = startParams.getProperty(Property.LANG_PERMISSIONS_CACHE_SIZE);
 		permissionsCacheSize = PropertyUtil.intPropertyValue(Property.LANG_PERMISSIONS_CACHE_SIZE, value,
 									   0, Integer.MAX_VALUE, Property.LANG_PERMISSIONS_CACHE_SIZE_DEFAULT);
@@ -694,9 +688,6 @@ public final class	DataDictionaryImpl
 		sequenceGeneratorCache = cf.newCacheManager
             ( this, "SequenceGeneratorCache", seqgenCacheSize, seqgenCacheSize );
 
-		idGeneratorCache = cf.newCacheManager
-            ( this, "IdentityGeneratorCache", idgenCacheSize, idgenCacheSize );
-
 		/* Get the object to coordinate cache transitions */
 		cacheCoordinator = new ShExLockable();
 
@@ -988,7 +979,6 @@ public final class	DataDictionaryImpl
 		else if ( cm == nameTdCache ) { return new NameTDCacheable( this ); }
         else if ( cm == permissionsCache ) { return new PermissionsCacheable( this ); }
         else if ( cm == sequenceGeneratorCache ) { return new SequenceUpdater.SyssequenceUpdater( this ); }
-        else if ( cm == idGeneratorCache ) { return new SequenceUpdater.SyscolumnsUpdater( this ); }
 		else { return new SPSNameCacheable( this ); }
 	}
 
@@ -8639,26 +8629,91 @@ public final class	DataDictionaryImpl
 		return rla;
 	}
     
-	private RowLocation computeIdentityRowLocation(TransactionController tc,
- 													TableDescriptor td)
- 				throws StandardException
- 	{
- 		int size;
-		if (!(td.tableHasAutoincrement())) { return null; }
- 
- 		size = td.getNumberOfColumns();
- 
- 		for (int i = 0; i < size; i++)
- 		{
- 			ColumnDescriptor cd = td.getColumnDescriptor(i + 1);
- 			if (cd.isAutoincrement())
+
+	/**
+	 * @see DataDictionary#getSetAutoincrementValue
+	 */
+	public NumberDataValue getSetAutoincrementValue(
+											RowLocation rl, 
+											TransactionController tc,
+											boolean doUpdate,
+											NumberDataValue newValue,
+											boolean wait)
+	       throws StandardException
+	{
+
+		FormatableBitSet columnToUpdate = new 
+  			FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
+  		int columnNum = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;
+		TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
+  		ConglomerateController heapCC = null;
+		SYSCOLUMNSRowFactory	rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
+		ExecRow row = rf.makeEmptyRow();
+
+  		FormatableBitSet  columnToRead = new
+  			FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
+		
+		// FormatableBitSet is 0 based.
+  		columnToRead.set(columnNum - 1); // current value.
+		columnToRead.set(columnNum);     // start value.
+		columnToRead.set(columnNum + 1); // increment value.
+
+        try
+        {
+			/* if wait is true then we need to do a wait while trying to
+			   open/fetch from the conglomerate. note we use wait both to
+			   open as well as fetch from the conglomerate.
+			*/
+            heapCC = 
+                tc.openConglomerate(
+                    ti.getHeapConglomerate(), 
+                    false,
+                    (TransactionController.OPENMODE_FORUPDATE |
+                     ((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),
+                    TransactionController.MODE_RECORD,
+                    TransactionController.ISOLATION_REPEATABLE_READ);
+
+            boolean baseRowExists = 
+                heapCC.fetch(rl, row.getRowArray(), columnToRead, wait);
+
+            columnToUpdate.set(columnNum - 1); // current value.
+
+            // while the Row interface is 1 based.
+            NumberDataValue currentAI = (NumberDataValue)row.getColumn(columnNum);
+            long currentAIValue = currentAI.getLong();
+            
+            if (doUpdate)
             {
-				return computeRowLocation(tc, td, cd.getColumnName());
+                // we increment and store the new value in SYSCOLUMNS
+                NumberDataValue increment = (NumberDataValue)row.getColumn(columnNum + 2);
+                currentAI = currentAI.plus(currentAI, increment, currentAI);
+                row.setColumn(columnNum, currentAI);
+                heapCC.replace(rl, row.getRowArray(), columnToUpdate);
             }
- 		}
-        
-		return null;
- 	}
+                
+            // but we return the "currentAIValue"-- i.e the value before
+            // incrementing it. 
+            if (newValue != null)
+            {
+                // user has passed in an object; set the current value in there and
+                // return it.
+                newValue.setValue(currentAIValue);
+                return newValue;
+            }
+            
+            else
+            {
+                // reuse the object read from row.
+                currentAI.setValue(currentAIValue);
+                return currentAI;
+            }
+        }
+        finally
+        {
+            if (heapCC != null)
+                heapCC.close();
+        }
+	}
 
 	private	ConglomerateDescriptor	bootstrapOneIndex
 	(
@@ -8825,12 +8880,10 @@ public final class	DataDictionaryImpl
 	{
 		nameTdCache.cleanAll();
 		nameTdCache.ageOut();
-
 		OIDTdCache.cleanAll();
 		OIDTdCache.ageOut();
-
-        clearSequenceCaches();
-
+		sequenceGeneratorCache.cleanAll();
+		sequenceGeneratorCache.ageOut();
 		if (spsNameCache != null)
 		{
 			//System.out.println("CLEARING SPS CACHE");
@@ -8841,19 +8894,6 @@ public final class	DataDictionaryImpl
 		}
 	}
 
-    /**
-       Flush sequence caches to disk so that we don't leak unused, pre-allocated numbers.
-    */
-    public void    clearSequenceCaches() throws StandardException
-    {
-		sequenceGeneratorCache.cleanAll();
-		sequenceGeneratorCache.ageOut();
-
-		idGeneratorCache.cleanAll();
-		idGeneratorCache.ageOut();
-    }
-    
-
 	/**
 		Add the required entries to the data dictionary for a System table.
 	*/
@@ -9969,8 +10009,7 @@ public final class	DataDictionaryImpl
 
 	/**
 	 * sets a new value in SYSCOLUMNS for a particular
-	 * autoincrement column. this throws away the sequence generator for the
-     * value so that it must be created from scratch.
+	 * autoincrement column.
 	 * 
 	 * @param tc		 Transaction Controller to use.
 	 * @param columnName Name of the column.
@@ -10020,23 +10059,9 @@ public final class	DataDictionaryImpl
 					 bArray, 
 					 colsToUpdate,
 					 tc);
-
-        // remove the generator for this identity column so that it will be reinitialized with the new value.
-        flushIdentityFromCache( tableUUID );
-        
 		return;
 	}
 
-    /**
-     * Remove an id generator from the cache so that it will have to be recreated.
-     * This method is called after changing the generator on disk.
-     */
-    private void    flushIdentityFromCache( UUID tableID ) throws StandardException
-    {
-        Cacheable   idGenerator = idGeneratorCache.findCached( tableID.toString() );
-        if ( idGenerator != null ) { idGeneratorCache.remove( idGenerator ); }
-    }
-
 	/**
 	 * Computes the RowLocation in SYSCOLUMNS for a particular 
 	 * autoincrement column.
@@ -10065,108 +10090,6 @@ public final class	DataDictionaryImpl
 	}
 
 	/**
-	 * Computes the RowLocation in SYSCOLUMNS for the identity column of a table. Also
-     * constructs a sequence descriptor describing the current state of the identity sequence.
-	 * 
-	 * @param tc			Transaction Controller to use.
-	 * @param tableIDstring UUID of the table as a string
-	 * @param rowLocation OUTPUT param for returing the row location
-	 * @param sequenceDescriptor OUTPUT param for return the sequence descriptor
-     *
-	 * @exception StandardException thrown on failure.
-	 */ 
-	void computeIdentityRowLocation
-        ( TransactionController tc, String tableIDstring, RowLocation[] rowLocation, SequenceDescriptor[] sequenceDescriptor )
-		throws StandardException								  
-	{
-        UUID    tableID = getUUIDFactory().recreateUUID( tableIDstring );
-        TableDescriptor td = getTableDescriptor( tableID );
-
-        // there should only be 1 identity column per table
-        rowLocation[ 0 ] = computeIdentityRowLocation( tc, td );
-
-		TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
-  		ConglomerateController heapCC = null;
-		SYSCOLUMNSRowFactory	rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
-		ExecRow row = rf.makeEmptyRow();
-		FormatableBitSet columnsToFetch = new FormatableBitSet( SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT );
-
-        for ( int i = 0; i < SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT; i++ )
-        {
-            columnsToFetch.set( i );
-        }
-
-        try
-        {
-            heapCC = 
-                tc.openConglomerate(
-                    ti.getHeapConglomerate(), 
-                    false,
-                    0,
-                    TransactionController.MODE_RECORD,
-                    TransactionController.ISOLATION_REPEATABLE_READ);
-
-            heapCC.fetch( rowLocation[ 0 ], row.getRowArray(), columnsToFetch, true );
-
-            ColumnDescriptor    cd = (ColumnDescriptor) rf.buildDescriptor( row, td, this );
-            DataTypeDescriptor  dtd = cd.getType();
-            Long[]  minMax = SequenceDescriptor.computeMinMax( dtd, null, null );
-
-            sequenceDescriptor[ 0 ] = getDataDescriptorGenerator().newSequenceDescriptor
-                (
-                 td.getSchemaDescriptor(),
-                 td.getUUID(),
-                 td.getName(),
-                 dtd,
-                 new Long( cd.getAutoincValue() ),
-                 cd.getAutoincStart(),
-                 minMax[ SequenceDescriptor.MIN_VALUE ].longValue(),
-                 minMax[ SequenceDescriptor.MAX_VALUE ].longValue(),
-                 cd.getAutoincInc(),
-                 false
-                 );
-        }
-        finally
-        {
-            if (heapCC != null) { heapCC.close(); }
-        }
-	}
-
-	/**
-	 * Set the current value of an identity sequence. This method does not perform
-     * any sanity checking but assumes that the caller knows what they are doing. If the
-     * old value on disk is not what we expect it to be, then we are in a race with another
-     * session. They won and we don't update the value on disk. However, if the old value
-     * is null, that is a signal to us that we should update the value on disk anyway.
-	 * 
-	 * @param tc			Transaction Controller to use.
-	 * @param rowLocation Row in SYSCOLUMNS to update.
-     * @param wait True if we should wait for locks
-     * @param oldValue What we expect to find in the AUTOINCREMENTVALUE column.
-     * @param newValue What to stuff into the AUTOINCREMENTVALUE column.
-	 * 
-	 * @return Returns true if the value was successfully updated, false if we lost a race with another session.
-     *
-	 * @exception StandardException thrown on failure.
-	 */
-    boolean updateCurrentIdentityValue
-        ( TransactionController tc, RowLocation rowLocation, boolean wait, Long oldValue, Long newValue )
-        throws StandardException
-    {
-        return updateCurrentSeqValue
-            (
-             tc,
-             rowLocation,
-             wait,
-             oldValue,
-             newValue,
-             coreInfo[SYSCOLUMNS_CORE_NUM],
-             SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT,
-             SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE
-             );
-    }
-    
-	/**
 	 * Computes the RowLocation in SYSSEQUENCES for a particular sequence. Also
      * constructs the sequence descriptor.
 	 * 
@@ -10224,55 +10147,11 @@ public final class	DataDictionaryImpl
         ( TransactionController tc, RowLocation rowLocation, boolean wait, Long oldValue, Long newValue )
         throws StandardException
     {
-        return updateCurrentSeqValue
-            (
-             tc,
-             rowLocation,
-             wait,
-             oldValue,
-             newValue,
-             getNonCoreTI( SYSSEQUENCES_CATALOG_NUM ),
-             SYSSEQUENCESRowFactory.SYSSEQUENCES_COLUMN_COUNT,
-             SYSSEQUENCESRowFactory.SYSSEQUENCES_CURRENT_VALUE
-             );
-    }
-    
-	/**
-	 * Set the current value of an ANSI/ISO sequence or identity column. This method does not perform
-     * any sanity checking but assumes that the caller knows what they are doing. If the
-     * old value on disk is not what we expect it to be, then we are in a race with another
-     * session. They won and we don't update the value on disk. However, if the old value
-     * is null, that is a signal to us that we should update the value on disk anyway.
-	 * 
-	 * @param tc			Transaction Controller to use.
-	 * @param rowLocation Row in SYSSEQUENCES or SYSCOLUMNS to update.
-     * @param wait True if we should wait for locks
-     * @param oldValue What we expect to find in the currentvalue column.
-     * @param newValue What to stuff into the current value column.
-     * @param ti Table info for the catalog that is being updated.
-     * @param columnsInRow Number of columns in the catalog row.
-     * @param columnNum ID of the current value column
-	 * 
-	 * @return Returns true if the value was successfully updated, false if we lost a race with another session.
-     *
-	 * @exception StandardException thrown on failure.
-	 */
-    private boolean updateCurrentSeqValue
-        (
-         TransactionController tc,
-         RowLocation rowLocation,
-         boolean wait,
-         Long oldValue,
-         Long newValue,
-         TabInfoImpl    ti,
-         int    columnsInRow,
-         int    columnNum
-         )
-        throws StandardException
-    {
-		FormatableBitSet columnToUpdate = new FormatableBitSet( columnsInRow );
+  		int columnNum = SYSSEQUENCESRowFactory.SYSSEQUENCES_CURRENT_VALUE;
+		FormatableBitSet columnToUpdate = new FormatableBitSet( SYSSEQUENCESRowFactory.SYSSEQUENCES_COLUMN_COUNT );
+		TabInfoImpl ti = getNonCoreTI( SYSSEQUENCES_CATALOG_NUM );
   		ConglomerateController heapCC = null;
-		CatalogRowFactory	rf = ti.getCatalogRowFactory();
+		SYSSEQUENCESRowFactory	rf = (SYSSEQUENCESRowFactory) ti.getCatalogRowFactory();
 		ExecRow row = rf.makeEmptyRow();
         
 		// FormatableBitSet is 0 based.
@@ -10328,28 +10207,13 @@ public final class	DataDictionaryImpl
 	 * @see org.apache.derby.iapi.sql.dictionary.DataDictionary#getCurrentValueAndAdvance
 	 */
     public void getCurrentValueAndAdvance
-        ( int catalogNumber, String uuidString, NumberDataValue returnValue )
+        ( String sequenceUUIDstring, NumberDataValue returnValue )
         throws StandardException
     {
-        CacheManager    cm = null;
         SequenceUpdater sequenceUpdater = null;
 
         try {
-            switch( catalogNumber )
-            {
-            case SYSSEQUENCES_CATALOG_NUM:
-                cm = sequenceGeneratorCache;
-                break;
-
-            case SYSCOLUMNS_CATALOG_NUM:
-                cm = idGeneratorCache;
-                break;
-
-            default:
-                throw StandardException.newException( SQLState.BTREE_UNIMPLEMENTED_FEATURE );
-            }
-
-            sequenceUpdater = (SequenceUpdater) cm.find( uuidString );
+            sequenceUpdater = (SequenceUpdater) sequenceGeneratorCache.find( sequenceUUIDstring );
 
             sequenceUpdater.getCurrentValueAndAdvance( returnValue );
         }
@@ -10357,7 +10221,7 @@ public final class	DataDictionaryImpl
         {
             if ( sequenceUpdater != null )
             {
-                cm.release( sequenceUpdater );
+                sequenceGeneratorCache.release( sequenceUpdater );
             }
         }
     }

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java Thu Oct  6 17:36:41 2011
@@ -20,7 +20,6 @@
  */
 package org.apache.derby.impl.sql.catalog;
 
-import org.apache.derby.catalog.SequencePreallocator;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.cache.Cacheable;
@@ -112,6 +111,14 @@ public class SequenceGenerator
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
+    /**
+     * Default number of values to pre-allocate. In the future, we may want to provide
+     * something more sophisticated. For instance, we might want to make Derby tune
+     * this number per sequence generator or give the user the power to override Derby's
+     * decision.
+     */
+    public static final int DEFAULT_PREALLOCATION_COUNT = 5;
+
     /** If pre-allocation drops below this level, then we need to grab another chunk of numbers */
     private static final int PREALLOCATION_THRESHHOLD = 1;
 
@@ -161,15 +168,9 @@ public class SequenceGenerator
     // This is where we restart the sequence if we wrap around.
     private final long _RESTART_VALUE;
 
-    // Name of the schema that the sequence lives in.
-    private final String _SCHEMA_NAME;
-
-    // Name of the sequence.
+    // Name of the sequence (for error messages).
     private final String _SEQUENCE_NAME;
 
-    // Logic to determine how many values to pre-allocate
-    private final   SequencePreallocator    _PREALLOCATOR;
-
     ///////////////////////////////////////////////////////////////////////////////////
     //
     // VARIABLES
@@ -182,6 +183,12 @@ public class SequenceGenerator
     // This is the next value which the generator will hand out.
     private long _currentValue;
 
+    // This is the number of values to pre-allocate per chunk. Right now this
+    // is a constant which we figure out when we initialize the generator.
+    // However, this number could change over time if, for instance, Derby
+    // tunes it on the fly.
+    private long _valuesPerAllocation;
+    
     // This is the remaining number of values which were pre-allocated on disk
     // by bumping the contents of SYSSEQUENCES.CURRENTVALUE.
     private long _remainingPreallocatedValues;
@@ -202,9 +209,7 @@ public class SequenceGenerator
          long maxValue,
          long minValue,
          long restartValue,
-         String schemaName,
-         String sequenceName,
-         SequencePreallocator   sequencePreallocator
+         String sequenceName
          )
     {
         if ( currentValue == null )
@@ -224,14 +229,14 @@ public class SequenceGenerator
         _MIN_VALUE = minValue;
         _RESTART_VALUE = restartValue;
         _STEP_INCREASES = ( _INCREMENT > 0 );
-        _SCHEMA_NAME = schemaName;
         _SEQUENCE_NAME = sequenceName;
-        _PREALLOCATOR = sequencePreallocator;
 
         //
         // Next call to getCurrentValueAndAdvance() will cause  us to ask our caller to allocate a new range of values.
         //
         _remainingPreallocatedValues = 1L;
+
+        _valuesPerAllocation = computePreAllocationCount();
     }
     
     ///////////////////////////////////////////////////////////////////////////////////
@@ -242,15 +247,6 @@ public class SequenceGenerator
 
     /**
      * <p>
-     * Get the name of the schema of this sequence generator. Technically, this doesn't need to be
-     * synchronized. But it is simpler to just maintain a rule that all public methods
-     * should be synchronized.
-     * </p>
-     */
-    public synchronized String getSchemaName() { return _SCHEMA_NAME; }
-    
-    /**
-     * <p>
      * Get the name of this sequence generator. Technically, this doesn't need to be
      * synchronized. But it is simpler to just maintain a rule that all public methods
      * should be synchronized.
@@ -303,7 +299,7 @@ public class SequenceGenerator
         if ( _isExhausted )
         {
             throw StandardException.newException
-                ( SQLState.LANG_SEQUENCE_GENERATOR_EXHAUSTED, _SCHEMA_NAME, _SEQUENCE_NAME );
+                ( SQLState.LANG_SEQUENCE_GENERATOR_EXHAUSTED, _SEQUENCE_NAME );
         }
 
         long retval[] = new long[ CVAA_LENGTH ];
@@ -407,8 +403,6 @@ public class SequenceGenerator
      */
     private void computeNewAllocation( long oldCurrentValue, long[] retval ) throws StandardException
     {
-        int preferredValuesPerAllocation = computePreAllocationCount();
-        
         //
         // The values are growing toward one of the endpoints of the legal range,
         // either the largest legal value or the smallest legal value. First find out
@@ -420,10 +414,10 @@ public class SequenceGenerator
         long newValueOnDisk;
         long valuesToAllocate;
 
-        if ( remainingLegalValues >= preferredValuesPerAllocation )
+        if ( remainingLegalValues >= _valuesPerAllocation )
         {
-            newValueOnDisk = oldCurrentValue + ( preferredValuesPerAllocation * _INCREMENT );
-            valuesToAllocate = preferredValuesPerAllocation;
+            newValueOnDisk = oldCurrentValue + ( _valuesPerAllocation * _INCREMENT );
+            valuesToAllocate = _valuesPerAllocation;
         }
         else
         {
@@ -431,13 +425,13 @@ public class SequenceGenerator
 
             if ( _CAN_CYCLE )
             {
-                long spillOverValues = preferredValuesPerAllocation - remainingLegalValues;
+                long spillOverValues = _valuesPerAllocation - remainingLegalValues;
 
                 // account for the fact that the restart value itself is a legal value
                 spillOverValues--;
 
                 newValueOnDisk = _RESTART_VALUE + ( spillOverValues * _INCREMENT );
-                valuesToAllocate = preferredValuesPerAllocation;
+                valuesToAllocate = _valuesPerAllocation;
             }
             else
             {
@@ -496,11 +490,9 @@ public class SequenceGenerator
      */
     private int computePreAllocationCount()
     {
-        int happyResult = _PREALLOCATOR.nextRangeSize(  _SCHEMA_NAME, _SEQUENCE_NAME );
+        int happyResult = DEFAULT_PREALLOCATION_COUNT;
         int unhappyResult = PREALLOCATION_THRESHHOLD;
 
-        if ( happyResult < unhappyResult ) { return unhappyResult; }
-
         double min = _MIN_VALUE;
         double max = _MAX_VALUE;
         double range = max - min;

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java Thu Oct  6 17:36:41 2011
@@ -20,10 +20,8 @@
  */
 package org.apache.derby.impl.sql.catalog;
 
-import org.apache.derby.catalog.SequencePreallocator;
 import org.apache.derby.iapi.db.Database;
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.cache.Cacheable;
 import org.apache.derby.iapi.services.cache.CacheManager;
@@ -155,7 +153,7 @@ public abstract class SequenceUpdater im
     
     ///////////////////////////////////////////////////////////////////////////////////
     //
-    // ABSTRACT OR OVERRIDABLE BEHAVIOR TO BE IMPLEMENTED BY CHILDREN
+    // ABSTRACT BEHAVIOR TO BE IMPLEMENTED BY CHILDREN
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
@@ -187,19 +185,6 @@ public abstract class SequenceUpdater im
      */
     abstract protected boolean updateCurrentValueOnDisk( TransactionController tc, Long oldValue, Long newValue, boolean wait ) throws StandardException;
     
-    /**
-     * <p>
-     * Create an exception to state that there is too much contention on the generator.
-     * For backward compatibility reasons, different messages are needed by sequences
-     * and identities. See DERBY-5426.
-     * </p>
-     */
-    protected   StandardException   tooMuchContentionException()
-    {
-        return StandardException.newException
-            ( SQLState.LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE, _sequenceGenerator.getName() );
-    }
-    
     ///////////////////////////////////////////////////////////////////////////////////
     //
     // Cacheable BEHAVIOR
@@ -223,7 +208,6 @@ public abstract class SequenceUpdater im
                 String  errorMessage = MessageService.getTextMessage
                     (
                      SQLState.LANG_CANT_FLUSH_PREALLOCATOR,
-                     _sequenceGenerator.getSchemaName(),
                      _sequenceGenerator.getName()
                      );
 
@@ -335,10 +319,10 @@ public abstract class SequenceUpdater im
         ( NumberDataValue returnValue ) throws StandardException
     {
         Long startTime = null;
-
+        
         //
-        // We try to get a sequence number. We try until we've exceeded the lock timeout
-        // in case we find ourselves in a race with another session which is draining numbers from
+        // We try to get a sequence number. We try a couple times in case we find
+        // ourselves in a race with another session which is draining numbers from
         // the same sequence generator.
         //
         while ( true )
@@ -390,16 +374,18 @@ public abstract class SequenceUpdater im
                 ( (System.currentTimeMillis() - startTime.longValue()) > _lockTimeoutInMillis )
                 )
             {
-                //
-                // If we get here, then we exhausted our retry attempts. This might be a sign
-                // that we need to increase the number of sequence numbers which we
-                // allocate. There's an opportunity for Derby to tune itself here.
-                //
-                throw tooMuchContentionException();
+                break;
             }
             
         } // end of retry loop
 
+        //
+        // If we get here, then we exhausted our retry attempts. This might be a sign
+        // that we need to increase the number of sequence numbers which we
+        // allocate. There's an opportunity for Derby to tune itself here.
+        //
+        throw StandardException.newException
+            ( SQLState.LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE, _sequenceGenerator.getName() );
     }
 
     /**
@@ -494,47 +480,6 @@ public abstract class SequenceUpdater im
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
-    /** Make a new range allocator (called when the generator is instantiated) */
-    protected SequencePreallocator  makePreallocator( TransactionController tc )
-        throws StandardException
-    {
-        String  propertyName = Property.LANG_SEQUENCE_PREALLOCATOR;
-        String  className = PropertyUtil.getServiceProperty( tc, propertyName );
-
-        if ( className == null ) { return new SequenceRange(); }
-
-        try {
-            // If the property value was a number rather than a class name, then
-            // use that as the default size for preallocated ranges.
-            if ( isNumber( className ) )
-            {
-                return new SequenceRange( Integer.parseInt( className ) );
-            }
-            
-            return (SequencePreallocator) Class.forName( className ).newInstance();
-        }
-        catch (ClassNotFoundException e) { throw missingAllocator( propertyName, className, e ); }
-        catch (ClassCastException e) { throw missingAllocator( propertyName, className, e ); }
-        catch (InstantiationException e) { throw missingAllocator( propertyName, className, e ); }
-        catch (IllegalAccessException e) { throw missingAllocator( propertyName, className, e ); }
-        catch (NumberFormatException e) { throw missingAllocator( propertyName, className, e ); }
-    }
-    private StandardException   missingAllocator( String propertyName, String className, Exception e )
-    {
-        return StandardException.newException( SQLState.LANG_UNKNOWN_SEQUENCE_PREALLOCATOR, e, propertyName, className );
-    }
-    private boolean isNumber( String text )
-    {
-        int length = text.length();
-
-        for ( int i = 0; i < length; i++ )
-        {
-            if ( !Character.isDigit( text.charAt( i ) ) ) { return false; }
-        }
-
-        return true;
-    }
-    
     /** Get the time we wait for a lock, in milliseconds--overridden by unit tests */
     protected int getLockTimeout()
     {
@@ -555,73 +500,13 @@ public abstract class SequenceUpdater im
 
     ///////////////////////////////////////////////////////////////////////////////////
     //
-    // NESTED CLASSES
+    // INNER CLASSES
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
     /**
      * <p>
      * Specific implementation of SequenceUpdater for the sequences managed by
-     * SYSCOLUMNS.
-     * </p>
-     */
-    public static final class SyscolumnsUpdater extends SequenceUpdater
-    {
-        private RowLocation _sequenceRowLocation;
-
-        public SyscolumnsUpdater() { super(); }
-        public SyscolumnsUpdater( DataDictionaryImpl dd ) { super( dd ); }
-    
-        //
-        // SequenceUpdater BEHAVIOR
-        //
-
-        protected SequenceGenerator createSequenceGenerator( TransactionController readOnlyTC )
-            throws StandardException
-        {
-            RowLocation[] rowLocation = new RowLocation[ 1 ];
-            SequenceDescriptor[] sequenceDescriptor = new SequenceDescriptor[ 1 ];
-            
-            _dd.computeIdentityRowLocation( readOnlyTC, _uuidString, rowLocation, sequenceDescriptor );
-            
-            _sequenceRowLocation = rowLocation[ 0 ];
-            
-            SequenceDescriptor isd = sequenceDescriptor[ 0 ];
-            
-            return new SequenceGenerator
-                (
-                 isd.getCurrentValue(),
-                 isd.canCycle(),
-                 isd.getIncrement(),
-                 isd.getMaximumValue(),
-                 isd.getMinimumValue(),
-                 isd.getStartValue(),
-                 isd.getSchemaDescriptor().getSchemaName(),
-                 isd.getSequenceName(),
-                 makePreallocator( readOnlyTC )
-                 );
-        }
-
-        protected boolean updateCurrentValueOnDisk( TransactionController tc, Long oldValue, Long newValue, boolean wait ) throws StandardException
-        {
-            return _dd.updateCurrentIdentityValue( tc, _sequenceRowLocation, wait, oldValue, newValue );
-        }
-
-        /**
-         * Wrap the "too much contention" exception in a "lock timeout" exception in
-         * order to preserve the old error behavior of identity columns. See DERBY-5426.
-         */
-        protected   StandardException   tooMuchContentionException()
-        {
-            StandardException   tooMuchContention = super.tooMuchContentionException();
-
-            return StandardException.newException( SQLState.LOCK_TIMEOUT, tooMuchContention );
-        }
-    }
-
-    /**
-     * <p>
-     * Specific implementation of SequenceUpdater for the sequences managed by
      * SYSSEQUENCES.
      * </p>
      */
@@ -656,9 +541,7 @@ public abstract class SequenceUpdater im
                  isd.getMaximumValue(),
                  isd.getMinimumValue(),
                  isd.getStartValue(),
-                 isd.getSchemaDescriptor().getSchemaName(),
-                 isd.getSequenceName(),
-                 makePreallocator( readOnlyTC )
+                 isd.getSequenceName()
                  );
         }
 

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/CreateSequenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/CreateSequenceNode.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/CreateSequenceNode.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/CreateSequenceNode.java Thu Oct  6 17:36:41 2011
@@ -26,7 +26,6 @@ import org.apache.derby.iapi.services.sa
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-import org.apache.derby.iapi.sql.dictionary.SequenceDescriptor;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.types.TypeId;
@@ -84,9 +83,17 @@ public class CreateSequenceNode extends 
 
         _stepValue = (stepValue != null ? (Long) stepValue : new Long(1));
 
-        Long[]  minMax = SequenceDescriptor.computeMinMax( _dataType, minValue, maxValue );
-        _minValue = minMax[ SequenceDescriptor.MIN_VALUE ];
-        _maxValue = minMax[ SequenceDescriptor.MAX_VALUE ];
+        if (_dataType.getTypeId().equals(TypeId.SMALLINT_ID)) {
+            _minValue = (minValue != null ? (Long) minValue : new Long(Short.MIN_VALUE));
+            _maxValue = (maxValue != null ? (Long) maxValue : new Long(Short.MAX_VALUE));
+        } else if (_dataType.getTypeId().equals(TypeId.INTEGER_ID)) {
+            _minValue = (minValue != null ? (Long) minValue : new Long(Integer.MIN_VALUE));
+            _maxValue = (maxValue != null ? (Long) maxValue : new Long(Integer.MAX_VALUE));
+        } else {
+            // Could only be BIGINT
+            _minValue = (minValue != null ? (Long) minValue : new Long(Long.MIN_VALUE));
+            _maxValue = (maxValue != null ? (Long) maxValue : new Long(Long.MAX_VALUE));
+        }
 
         if (initialValue != null) {
             _initialValue = (Long) initialValue;

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/compile/NextSequenceNode.java Thu Oct  6 17:36:41 2011
@@ -28,7 +28,6 @@ import org.apache.derby.iapi.services.co
 import org.apache.derby.iapi.services.compiler.LocalField;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.services.classfile.VMOpcode;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SequenceDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 
@@ -134,7 +133,6 @@ public class NextSequenceNode extends Va
         int dataTypeFormatID = sequenceDescriptor.getDataType().getNull().getTypeFormatId();
         
 		mb.pushThis();
-		mb.push( DataDictionary.SYSSEQUENCES_CATALOG_NUM );
 		mb.push( sequenceUUIDstring );
 		mb.push( dataTypeFormatID );
 		mb.callMethod
@@ -143,7 +141,7 @@ public class NextSequenceNode extends Va
              ClassName.BaseActivation,
              "getCurrentValueAndAdvance",
              ClassName.NumberDataValue,
-             3
+             2
              );
     }
 

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java Thu Oct  6 17:36:41 2011
@@ -670,23 +670,22 @@ public abstract class BaseActivation imp
 	}
 
 	/**
-	 * Called by generated code to get the next number in an identity or sequence generator
-     * and advance the generator. Raises an exception if the generator was declared
+	 * Called by generated code to get the next number in an ANSI/ISO sequence
+     * and advance the sequence. Raises an exception if the sequence was declared
      * NO CYCLE and its range is exhausted.
 	 *
-     * @param catalogNumber SYSCOLUMNS_CATALOG_NUM or SYSSEQUENCES_CATALOG_NUM, depending on the kind of generator
-     * @param uuidString The string value of the generator's uuid (table uuid for identity generators and sequence uuid for sequence generators)
+     * @param sequenceUUIDstring The string value of the sequence's UUID
      * @param typeFormatID The format id of the data type to be returned. E.g., StoredFormatIds.SQL_INTEGER_ID.
      *
 	 * @return The next number in the sequence
 	 */
 	protected NumberDataValue getCurrentValueAndAdvance
-        ( int catalogNumber, String uuidString, int typeFormatID )
+        ( String sequenceUUIDstring, int typeFormatID )
 	       throws StandardException
 	{
         NumberDataValue ndv = (NumberDataValue) getDataValueFactory().getNull( typeFormatID, StringDataValue.COLLATION_TYPE_UCS_BASIC );
 
-        lcc.getDataDictionary().getCurrentValueAndAdvance( catalogNumber, uuidString, ndv );
+        lcc.getDataDictionary().getCurrentValueAndAdvance( sequenceUUIDstring, ndv );
 
         return ndv;
 	}

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java Thu Oct  6 17:36:41 2011
@@ -251,6 +251,24 @@ public class InsertConstantAction extend
 	public long   getAutoincIncrement(int i) { return autoincIncrement[i]; }
 
 	/**
+	 * Does the target table has autoincrement columns.
+	 *
+	 * @return 	True if the table has ai columns
+	 */
+	public boolean hasAutoincrement()
+	{
+		return (autoincRowLocation != null);
+	}
+
+	/**
+	 * gets the row location 
+	 */
+	public RowLocation[] getAutoincRowLocation()
+	{
+		return autoincRowLocation;
+	}
+	
+	/**
 	 * Get the formatID which corresponds to this class.
 	 *
 	 *	@return	the formatID of this class

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java Thu Oct  6 17:36:41 2011
@@ -349,18 +349,19 @@ class InsertResultSet extends DMLWriteRe
 		// Is this a bulkInsert or regular insert?
 		String insertMode = constants.getProperty("insertMode");
 
-		if ( hasAutoincrement() )
+                RowLocation[] rla;
+
+		if ((rla = constants.getAutoincRowLocation()) != null)
 		{
-            int cacheLength = resultDescription.getColumnCount();
-			aiCache = new NumberDataValue[ cacheLength ];
-			for (int i = 0; i < cacheLength; i++)
+			aiCache = 
+				new NumberDataValue[rla.length];
+			for (int i = 0; i < resultDescription.getColumnCount(); i++)
 			{
+				if (rla[i] == null)
+					continue;
 				ResultColumnDescriptor rcd = 
 					resultDescription.getColumnDescriptor(i + 1);
-                if ( rcd.getType().getTypeId().isNumericTypeId() )
-                {
-                    aiCache[i] = (NumberDataValue)rcd.getType().getNull();
-                }
+				aiCache[i] = (NumberDataValue)rcd.getType().getNull();
 			}
 		}
 
@@ -390,18 +391,6 @@ class InsertResultSet extends DMLWriteRe
 
 		//System.out.println("new InsertResultSet " + sourceResultSet.getClass());
 	}
-
-    /**
-     * Return true if the table has an autoincrement column.
-     */
-    private boolean hasAutoincrement()  throws StandardException
-    {
-        // Global temporary tables don't have table descriptors but they
-        // don't have identity columns either
-        TableDescriptor tabdesc = getTableDescriptor();
-        if ( tabdesc == null ) { return false; }
-        else { return tabdesc.tableHasAutoincrement(); }
-    }
 	
 	/**
 		@exception StandardException Standard Derby error policy
@@ -592,28 +581,6 @@ class InsertResultSet extends DMLWriteRe
 		}
 	}
 
-    /**
-     * Get the table descriptor if it hasn't already been looked up.
-     */
-    private TableDescriptor getTableDescriptor()
-        throws StandardException
-    {
-        if ( td == null ) { td = getDataDictionary().getTableDescriptor(constants.targetUUID); }
-
-        return td;
-    }
-    
-    /**
-     * Get the data dictionary if it hasn't already been looked up.
-     */
-    private DataDictionary getDataDictionary()
-        throws StandardException
-    {
-        if ( dd == null ) { dd = lcc.getDataDictionary(); }
-
-        return dd;
-    }
-    
 	/**
 	 * If user didn't provide columns list for auto-generated columns, then only include
 	 * columns with auto-generated values in the resultset. Those columns would be ones
@@ -798,9 +765,9 @@ class InsertResultSet extends DMLWriteRe
 				}
 				else
 				{
-                    dvd = (NumberDataValue) aiCache[ index ].getNewNull();
-                    dd.getCurrentValueAndAdvance
-                        ( DataDictionary.SYSCOLUMNS_CATALOG_NUM, getTableDescriptor().getUUID().toString(), dvd );
+					dvd = dd.getSetAutoincrementValue(
+						    constants.autoincRowLocation[index],
+							tc, false, aiCache[index], true);
 					startValue = dvd.getLong();
 				}
 				lcc.autoincrementCreateCounter(td.getSchemaName(),
@@ -819,12 +786,77 @@ class InsertResultSet extends DMLWriteRe
 
 		else
 		{
-			NumberDataValue newValue = aiCache[ index ];
+			NumberDataValue newValue;
+			TransactionController nestedTC = null, tcToUse = tc;
+
+			try
+			{
+				nestedTC = tc.startNestedUserTransaction(false);
+				tcToUse = nestedTC;
+			}
+
+			catch (StandardException se)
+			{
+				// If I cannot start a Nested User Transaction use the parent
+				// transaction to do all the work.
+				tcToUse = tc;
+			}
+
+			try 
+			{
+				/* If tcToUse == tc, then we are using parent xaction-- this
+				   can happen if for some reason we couldn't start a nested
+				   transaction
+				*/
+				newValue = dd.getSetAutoincrementValue(
+						   constants.autoincRowLocation[index],
+						   tcToUse, true, aiCache[index], (tcToUse == tc));
+			}
 
-            dd.getCurrentValueAndAdvance
-                ( DataDictionary.SYSCOLUMNS_CATALOG_NUM, getTableDescriptor().getUUID().toString(), newValue );
+			catch (StandardException se)
+			{
+				if (tcToUse == tc)
+				{
+					/* we've using the parent xaction and we've timed out; just
+					   throw an error and exit.
+					*/
+					throw se;
+				}
 
-			if (setIdentity) { identityVal = newValue.getLong(); }
+				if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT))
+				{
+					// if we couldn't do this with a nested xaction, retry with
+					// parent-- we need to wait this time!
+					newValue = dd.getSetAutoincrementValue(
+									constants.autoincRowLocation[index],
+									tc, true, aiCache[index], true);
+				}
+				else if (se.getMessageId().equals(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE))
+				{
+					// if we got an overflow error, throw a more meaningful
+					// error message
+					throw StandardException.newException(
+												 SQLState.LANG_AI_OVERFLOW,
+												 se,
+												 constants.getTableName(),
+												 constants.getColumnName(index));
+				}
+				else throw se;
+			}
+			finally 
+			{
+				// no matter what, commit the nested transaction; if something
+				// bad happened in the child xaction lets not abort the parent
+				// here.
+				if (nestedTC != null)
+				{
+					nestedTC.commit();
+					nestedTC.destroy();
+				}
+			}
+			aiCache[index] = newValue;
+			if (setIdentity)
+				identityVal = newValue.getLong();
 		}
 
 		return aiCache[index];
@@ -857,7 +889,7 @@ class InsertResultSet extends DMLWriteRe
 	private void normalInsertCore(LanguageConnectionContext lcc, boolean firstExecute)
 		throws StandardException
 	{
-		boolean setUserIdentity = hasAutoincrement() && isSingleRowResultSet();
+		boolean setUserIdentity = constants.hasAutoincrement() && isSingleRowResultSet();
 		boolean	firstDeferredRow = true;
 		ExecRow	deferredRowBuffer = null;
                 long user_autoinc=0;

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages.xml?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages.xml Thu Oct  6 17:36:41 2011
@@ -674,8 +674,7 @@ Guide.
 
             <msg>
                 <name>2200H.S</name>
-                <text>Sequence generator '{0}.{1}' does not cycle. No more values can be obtained from this sequence generator.</text>
-                <arg>schemaName</arg>
+                <text>Sequence generator '{0}' does not cycle. No more values can be obtained from this sequence generator.</text>
                 <arg>sequenceName</arg>
             </msg>
 
@@ -3435,21 +3434,13 @@ Guide.
 
             <msg>
                 <name>X0Y84.S</name>
-                <text>Too much contention on sequence {0}. To avoid this error, try adjusting derby.locks.waitTimeout and/or derby.language.sequence.preallocator. See the Derby Reference Manual for more information on these properties.</text>
+                <text>Too much contention on sequence {0}.</text>
                 <arg>sequenceName</arg>
             </msg>
 
             <msg>
-                <name>X0Y85.S</name>
-                <text>The Derby property '{0}' identifies a class which cannot be instantiated: '{1}'. See the next exception for details.</text>
-                <arg>propertyName</arg>
-                <arg>className</arg>
-            </msg>
-
-            <msg>
                 <name>X0Y86.S</name>
-                <text>Derby could not obtain the locks needed to release the unused, preallocated values for the sequence '{0}'.'{1}'. As a result, unexpected gaps may appear in this sequence.</text>
-                <arg>schemaName</arg>
+                <text>Derby could not obtain the locks needed to release the unused, preallocated values for the sequence '{0}'. As a result, unexpected gaps may appear in this sequence.</text>
                 <arg>sequenceName</arg>
             </msg>
 

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_de_DE.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_de_DE.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_de_DE.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_de_DE.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=Die Zeichenfolgendarstellung eines datetime-Wertes liegt au\u00DFerhalb des Bereichs.
 22007.S.181=Die Syntax der Zeichenfolgendarstellung eines datetime-Wertes ist fehlerhaft.
 22008.S=''{0}'' ist ein ung\u00FCltiges Argument f\u00FCr die Funktion {1}.
-2200H.S=Sequenzgenerator ''{0}.{1}'' z\u00E4hlt nicht zyklisch weiter. Es k\u00F6nnen keine Werte mehr von diesem Sequenzgenerator angefordert werden.
+2200H.S=Sequenzgenerator ''{0}'' z\u00E4hlt nicht zyklisch weiter. Es k\u00F6nnen keine Werte mehr von diesem Sequenzgenerator angefordert werden.
 2200L=XML-Spalten zugeordnete Werte m\u00FCssen korrekt formatierte DOCUMENT-Knoten sein.
 2200M=Ung\u00FCltiges XML DOCUMENT\: {0}
 2200V=Ung\u00FCltiges Kontextelement f\u00FCr den Operator {0}. Kontextelemente m\u00FCssen korrekt formatierte DOCUMENT-Knoten sein.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_es.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_es.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_es.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_es.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=La representaci\u00F3n de serie de un valor de fecha y hora queda fuera de rango.
 22007.S.181=La sintaxis de la representaci\u00F3n de serie de un valor de fecha y hora es incorrecta.
 22008.S=''{0}'' es un argumento no v\u00E1lido en la funci\u00F3n {1}.
-2200H.S=El generador de secuencias ''{0}.{1}'' no recorre los elementos. No se pueden obtener m\u00E1s valores de este generador de secuencias.
+2200H.S=El generador de secuencias ''{0}'' no recorre los elementos. No se pueden obtener m\u00E1s valores de este generador de secuencias.
 2200L=Los valores asignados a columnas XML deben tener nodos DOCUMENT formados correctamente.
 2200M=DOCUMENT de XML no v\u00E1lido\: {0}
 2200V=Elemento de contexto no v\u00E1lido para el operador {0}; los elementos de contexto deben ser nodos DOCUMENT formados correctamente.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_fr.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_fr.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_fr.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_fr.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=La repr\u00E9sentation de la cha\u00EEne d''une valeur date/heure se situe hors de la fourchette admise.
 22007.S.181=La syntaxe de la repr\u00E9sentation de la cha\u00EEne d''une valeur date/heure n''est pas correcte.
 22008.S=''{0}'' est un argument non valide pour la fonction {1}.
-2200H.S=Le g\u00E9n\u00E9rateur de s\u00E9quence ''{0}.{1}'' ne fonctionne pas. Aucune autre valeur ne peut \u00EAtre obtenue de ce g\u00E9n\u00E9rateur de s\u00E9quence.
+2200H.S=Le g\u00E9n\u00E9rateur de s\u00E9quence ''{0}'' ne fonctionne pas. Aucune autre valeur ne peut \u00EAtre obtenue de ce g\u00E9n\u00E9rateur de s\u00E9quence.
 2200L=Les valeurs attribu\u00E9es aux colonnes XML doivent \u00EAtre des noeuds de type DOCUMENT syntaxiquement corrects.
 2200M=DOCUMENT XML non valide \: {0}
 2200V=El\u00E9ment contextuel incorrect pour l''op\u00E9rateur {0} ; les \u00E9l\u00E9ments contextuels doivent \u00EAtre des noeuds de type DOCUMENT syntaxiquement corrects.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_it.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_it.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_it.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_it.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=La rappresentazione della stringa di un valore data/ora non \u00E8 compresa nell''intervallo.
 22007.S.181=La sintassi della rappresentazione della stringa di un valore data/ora non \u00E8 corretta.
 22008.S=''{0}'' non \u00E8 un argomento valido per la funzione {1}.
-2200H.S=Il generatore di sequenze ''{0}.{1}'' non esegue il nuovo ciclo. Non \u00E8 possibile ottenere altri valori da questo generatore di sequenze.
+2200H.S=Il generatore di sequenze ''{0}'' non esegue il nuovo ciclo. Non \u00E8 possibile ottenere altri valori da questo generatore di sequenze.
 2200L=I valori assegnati alle colonne XML devono essere nodi DOCUMENT in formato corretto.
 2200M=DOCUMENTO XML non valido\: {0}
 2200V=Elemento di contesto non valido per l''operatore {0}; gli elementi di contesto devono essere nodi DOCUMENT in formato corretto.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ja_JP.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ja_JP.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ja_JP.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ja_JP.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=\u65E5\u6642\u5024\u306E\u30B9\u30C8\u30EA\u30F3\u30B0\u8868\u8A18\u304C\u7BC4\u56F2\u5916\u3067\u3059\u3002
 22007.S.181=\u65E5\u6642\u5024\u306E\u30B9\u30C8\u30EA\u30F3\u30B0\u8868\u8A18\u306E\u69CB\u6587\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002
 22008.S=''{0}'' \u306F {1} \u95A2\u6570\u306B\u5BFE\u3057\u3066\u7121\u52B9\u306A\u5F15\u6570\u3067\u3059\u3002
-2200H.S=\u30B7\u30FC\u30B1\u30F3\u30B9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF ''{0}.{1}'' \u306F\u5FAA\u74B0\u3057\u307E\u305B\u3093\u3002\u3053\u306E\u30B7\u30FC\u30B1\u30F3\u30B9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF\u304B\u3089\u306F\u3001\u3053\u308C\u4EE5\u4E0A\u5024\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002
+2200H.S=\u30B7\u30FC\u30B1\u30F3\u30B9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF ''{0}'' \u306F\u5FAA\u74B0\u3057\u307E\u305B\u3093\u3002\u3053\u306E\u30B7\u30FC\u30B1\u30F3\u30B9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF\u304B\u3089\u306F\u3001\u3053\u308C\u4EE5\u4E0A\u5024\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002
 2200L=XML \u5217\u306B\u5272\u308A\u5F53\u3066\u308B\u5024\u306F\u3001\u6574\u5F62\u5F0F DOCUMENT \u30CE\u30FC\u30C9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 2200M=\u7121\u52B9\u306A XML DOCUMENT\: {0}
 2200V={0} \u6F14\u7B97\u5B50\u306B\u5BFE\u3057\u3066\u7121\u52B9\u306A\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9805\u76EE\u3067\u3059\u3002\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9805\u76EE\u306F\u6574\u5F62\u5F0F DOCUMENT \u30CE\u30FC\u30C9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ko_KR.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ko_KR.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ko_KR.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_ko_KR.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=\uB0A0\uC9DC \uC2DC\uAC04 \uAC12\uC758 \uBB38\uC790\uC5F4 \uD45C\uC2DC\uAC00 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4.
 22007.S.181=\uB0A0\uC9DC \uC2DC\uAC04 \uAC12\uC758 \uBB38\uC790\uC5F4 \uD45C\uC2DC \uAD6C\uBB38\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
 22008.S=''{0}''\uC740(\uB294) {1} \uD568\uC218\uC5D0 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uC778\uC218\uC785\uB2C8\uB2E4.
-2200H.S=\uC2DC\uD000\uC2A4 \uC0DD\uC131\uAE30 ''{0}.{1}''\uC774(\uAC00) \uC21C\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC774 \uC2DC\uD000\uC2A4 \uC0DD\uC131\uAE30\uC5D0\uC11C \uB354 \uC774\uC0C1 \uAC12\uC744 \uC5BB\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
+2200H.S=\uC2DC\uD000\uC2A4 \uC0DD\uC131\uAE30 ''{0}''\uC774(\uAC00) \uC21C\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC774 \uC2DC\uD000\uC2A4 \uC0DD\uC131\uAE30\uC5D0\uC11C \uB354 \uC774\uC0C1 \uAC12\uC744 \uC5BB\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
 2200L=XML \uC5F4\uC5D0 \uC9C0\uC815\uB41C \uAC12\uC740 \uC798 \uAD6C\uC131\uB41C DOCUMENT \uB178\uB4DC\uC5EC\uC57C \uD569\uB2C8\uB2E4.
 2200M=\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XML DOCUMENT\: {0}
 2200V={0} \uC5F0\uC0B0\uC790\uC5D0 \uB300\uD574 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uCEE8\uD14D\uC2A4\uD2B8 \uD56D\uBAA9\uC785\uB2C8\uB2E4. \uCEE8\uD14D\uC2A4\uD2B8 \uD56D\uBAA9\uC740 \uC798 \uAD6C\uC131\uB41C DOCUMENT \uB178\uB4DC\uC5EC\uC57C \uD569\uB2C8\uB2E4.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_zh_TW.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_zh_TW.properties?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_zh_TW.properties (original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/loc/messages_zh_TW.properties Thu Oct  6 17:36:41 2011
@@ -112,7 +112,7 @@
 22007.S.180=\u65E5\u671F\u6642\u9593\u503C\u7684\u5B57\u4E32\u8868\u793A\u6CD5\u8D85\u51FA\u7BC4\u570D\u3002
 22007.S.181=\u65E5\u671F\u6642\u9593\u503C\u4E4B\u5B57\u4E32\u8868\u793A\u6CD5\u7684\u8A9E\u6CD5\u4E0D\u6B63\u78BA\u3002
 22008.S=\u5C0D {1} \u51FD\u6578\u800C\u8A00\uFF0C''{0}'' \u70BA\u7121\u6548\u7684\u5F15\u6578\u3002
-2200H.S=\u5E8F\u5217\u7522\u751F\u5668 ''{0}.{1}'' \u7121\u6CD5\u5FAA\u74B0\u3002\u7121\u6CD5\u5F9E\u9019\u500B\u5E8F\u5217\u7522\u751F\u5668\u53D6\u5F97\u66F4\u591A\u503C\u3002
+2200H.S=\u5E8F\u5217\u7522\u751F\u5668 ''{0}'' \u7121\u6CD5\u5FAA\u74B0\u3002\u7121\u6CD5\u5F9E\u9019\u500B\u5E8F\u5217\u7522\u751F\u5668\u53D6\u5F97\u66F4\u591A\u503C\u3002
 2200L=\u6307\u6D3E\u7D66 XML \u76F4\u6B04\u7684\u503C\u5FC5\u9808\u662F\u5F62\u5F0F\u5B8C\u6574\u7684 DOCUMENT \u7BC0\u9EDE\u3002
 2200M=XML DOCUMENT \u7121\u6548\uFF1A{0}
 2200V={0} \u904B\u7B97\u5B50\u7684\u74B0\u5883\u5B9A\u7FA9\u9805\u76EE\u7121\u6548\uFF1B\u74B0\u5883\u5B9A\u7FA9\u9805\u76EE\u5FC5\u9808\u662F\u5F62\u5F0F\u5B8C\u6574\u7684 DOCUMENT \u7BC0\u9EDE\u3002

Modified: db/derby/code/branches/10.8/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/branches/10.8/java/shared/org/apache/derby/shared/common/reference/SQLState.java Thu Oct  6 17:36:41 2011
@@ -721,8 +721,8 @@ public interface SQLState {
 	String LANG_INVALID_TRIM_SET                                       = "22027";
     String LANG_STRING_TOO_LONG                                        = "22028";
 	String LANG_ESCAPE_IS_NULL                                  	   = "22501";
-	String LANG_INVALID_ROW_COUNT_FIRST                                = "2201W";
 	String LANG_INVALID_ROW_COUNT_OFFSET                               = "2201X";
+	String LANG_INVALID_ROW_COUNT_FIRST                                = "2201W";
 	String LANG_ROW_COUNT_OFFSET_FIRST_IS_NULL                         = "2201Z";
 
 	/*
@@ -1372,7 +1372,6 @@ public interface SQLState {
 	String LANG_NULL_DATA_IN_NON_NULL_COLUMN               	   	   	   = "X0Y80.S";
     String LANG_IGNORE_MISSING_INDEX_ROW_DURING_DELETE                 = "X0Y83.S";
     String LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE                 = "X0Y84.S";
-	String LANG_UNKNOWN_SEQUENCE_PREALLOCATOR                                = "X0Y85.S";
 	String LANG_CANT_FLUSH_PREALLOCATOR                                = "X0Y86.S";
 
 

Modified: db/derby/code/branches/10.8/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java (original)
+++ db/derby/code/branches/10.8/java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java Thu Oct  6 17:36:41 2011
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.impl.storeless.EmptyDictionary
+   Derby - Class org.apache.impl.storeless.EmptyDictionary
 
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -79,11 +79,6 @@ public class EmptyDictionary implements 
 
 	}
 
-	public void clearSequenceCaches() throws StandardException {
-		// TODO Auto-generated method stub
-
-	}
-
 	public int startReading(LanguageConnectionContext lcc)
 			throws StandardException {
 		// TODO Auto-generated method stub
@@ -707,7 +702,7 @@ public class EmptyDictionary implements 
 	}
 
     public void getCurrentValueAndAdvance
-        ( int catalogNumber, String uuidString, NumberDataValue returnValue )
+        ( String sequenceUUIDstring, NumberDataValue returnValue )
         throws StandardException
     {
 		// TODO Auto-generated method stub
@@ -719,6 +714,13 @@ public class EmptyDictionary implements 
 		return null;
 	}
 
+	public NumberDataValue getSetAutoincrementValue(RowLocation rl,
+			TransactionController tc, boolean doUpdate,
+			NumberDataValue newValue, boolean wait) throws StandardException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 	public void setAutoincrementValue(TransactionController tc, UUID tableUUID,
 			String columnName, long aiValue, boolean incrementNeeded)
 			throws StandardException {

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java?rev=1179717&r1=1179716&r2=1179717&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AlterTableTest.java Thu Oct  6 17:36:41 2011
@@ -3204,7 +3204,7 @@ public final class AlterTableTest extend
                 "where c.referenceid = t.tableid and t.tablename='D3175'");
         JDBC.assertUnorderedResultSet(rs, new String[][]{
                     {"X", "1", "VARCHAR(12)", null, null, null, null, "D3175", "T", "R"},
-                    {"ID", "2", "INTEGER NOT NULL", "GENERATED_BY_DEFAULT", "22", "1", "1", "D3175", "T", "R"}
+                    {"ID", "2", "INTEGER NOT NULL", "GENERATED_BY_DEFAULT", "3", "1", "1", "D3175", "T", "R"}
                 });
     }
 



Mime
View raw message