db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r531971 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/store/access/ engine/org/apache/derby/iapi/store/raw/ engine/org/apache/derby/iapi/types/ engine/org/apache/derby/impl/db/ engine/org/apache/derby/impl/store/access/btree/...
Date Tue, 24 Apr 2007 15:10:07 GMT
Author: mikem
Date: Tue Apr 24 08:10:05 2007
New Revision: 531971

URL: http://svn.apache.org/viewvc?view=rev&rev=531971
Log:
DERBY-2537
This checkin implements the store code to call the new object allocation
interface that correctly sets the collation for the objects created.  After
this checkin persistent object created internally by store and initialized
by doing readExternal should correctly reflect the collation that the
columns are created with.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/RowUtil.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Transaction.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCompressScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/InternalXact.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java
    db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/NoOpTransaction.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/RowUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/RowUtil.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/RowUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/RowUtil.java Tue Apr 24 08:10:05 2007
@@ -21,18 +21,15 @@
 
 package org.apache.derby.iapi.store.access;
 
-import org.apache.derby.iapi.services.monitor.Monitor;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 import org.apache.derby.iapi.error.StandardException; 
-import org.apache.derby.iapi.services.io.Storable;
-import org.apache.derby.iapi.types.DataValueDescriptor;
 import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.io.Storable;
+import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import org.apache.derby.iapi.store.raw.FetchDescriptor;
 
-import java.lang.reflect.InvocationTargetException;
+import org.apache.derby.iapi.types.DataValueDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
 
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -359,8 +356,10 @@
 	 * @exception  StandardException  Standard exception policy.
      **/
     public static DataValueDescriptor[] newTemplate(
-    FormatableBitSet column_list,
-    int[]            format_ids) 
+    DataValueFactory    dvf,
+    FormatableBitSet    column_list,
+    int[]               format_ids,
+    int[]               collation_ids) 
         throws StandardException
     {
         int                   num_cols = format_ids.length;
@@ -384,8 +383,7 @@
 
                 // get empty instance of object identified by the format id.
 
-                ret_row[i] = (DataValueDescriptor) 
-                    Monitor.newInstanceFromIdentifier(format_ids[i]);
+                ret_row[i] = dvf.getNull(format_ids[i], collation_ids[i]);
             }
         }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Transaction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Transaction.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Transaction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Transaction.java Tue Apr 24 08:10:05 2007
@@ -21,14 +21,15 @@
 
 package org.apache.derby.iapi.store.raw;
 
+import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.daemon.Serviceable;
 import org.apache.derby.iapi.services.locks.CompatibilitySpace;
-import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.store.raw.log.LogInstant;
 import org.apache.derby.iapi.store.access.FileResource;
 import org.apache.derby.iapi.store.access.RowSource;
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.types.DataValueFactory;
 
 import java.util.Properties;
 
@@ -611,5 +612,17 @@
 	public String getActiveStateTxIdString();
 
 
-
+    /**
+     * Get DataValueFactory.
+     * <p>
+     * Return a DataValueFactory that can be used to allocate objects.  Used
+     * to make calls to: 
+     *     DataValueFactory.getInstanceUsingFormatIdAndCollationType()
+     *
+	 * @return a booted data value factory.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+    public DataValueFactory getDataValueFactory()
+		throws StandardException;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java Tue Apr 24 08:10:05 2007
@@ -44,6 +44,7 @@
 import org.apache.derby.iapi.services.io.RegisteredFormatIds;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.monitor.ModuleControl;
+import org.apache.derby.iapi.services.monitor.Monitor;
 
 import org.apache.derby.iapi.services.loader.ClassInfo;
 import org.apache.derby.iapi.services.loader.InstanceGetter;
@@ -1158,7 +1159,9 @@
      * @param formatId Return a DVD based on the format id
      * @return DataValueDescriptor with default collation of UCS_BASIC 
      */
-    public static DataValueDescriptor getNullDVDWithUCS_BASICcollation(int formatId){
+    public static DataValueDescriptor getNullDVDWithUCS_BASICcollation(
+    int formatId) {
+
         switch (formatId) {
         /* Wrappers */
         case StoredFormatIds.SQL_BIT_ID: return new SQLBit();
@@ -1186,6 +1189,11 @@
         case StoredFormatIds.SQL_CLOB_ID: return new SQLClob();
         case StoredFormatIds.SQL_NCLOB_ID: return new SQLNClob();
         case StoredFormatIds.XML_ID: return new XML();
+        case StoredFormatIds.ACCESS_HEAP_ROW_LOCATION_V1_ID: 
+        // This is an specific implementation of RowLocation, known to be
+        // a DTD.  
+             return(
+                 new org.apache.derby.impl.store.access.heap.HeapRowLocation());
         default:return null;
         }
     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java Tue Apr 24 08:10:05 2007
@@ -153,7 +153,9 @@
 			if (startParams.getProperty(Property.CREATE_WITH_NO_LOG) == null)
 				startParams.put(Property.CREATE_WITH_NO_LOG, "true");
 
-			String localeID = startParams.getProperty(org.apache.derby.iapi.reference.Attribute.TERRITORY);
+			String localeID = 
+                startParams.getProperty(
+                    org.apache.derby.iapi.reference.Attribute.TERRITORY);
 
 			if (localeID == null) {
 				localeID = Locale.getDefault().toString();
@@ -173,9 +175,15 @@
 		bootValidation(create, startParams);
 		
 		// boot the type factory before store to ensure any dynamically
-		// registered types (DECIMAL) are there before logical undo recovery might need them.
-		DataValueFactory dvf = (DataValueFactory) Monitor.bootServiceModule(create, this,
-				org.apache.derby.iapi.reference.ClassName.DataValueFactory, startParams);
+		// registered types (DECIMAL) are there before logical undo recovery 
+        // might need them.
+		DataValueFactory dvf = (DataValueFactory) 
+            Monitor.bootServiceModule(
+                create, 
+                this,
+				org.apache.derby.iapi.reference.ClassName.DataValueFactory, 
+                startParams);
+
 		//After booting the DVF, set the Locale information into it. This 
 		//Locale will be either the Locale obtained from the territory 
 		//attribute supplied by the user on the JDBC url at database create 
@@ -207,8 +215,13 @@
             Monitor.bootServiceModule(create, this,
                     DataDictionary.MODULE, allParams);
 
-		lcf = (LanguageConnectionFactory) Monitor.bootServiceModule(create, this, LanguageConnectionFactory.MODULE, allParams);
-		lf = (LanguageFactory) Monitor.bootServiceModule(create, this, LanguageFactory.MODULE, allParams);
+		lcf = (LanguageConnectionFactory) 
+            Monitor.bootServiceModule(
+                create, this, LanguageConnectionFactory.MODULE, allParams);
+
+		lf = (LanguageFactory) 
+            Monitor.bootServiceModule(
+                create, this, LanguageFactory.MODULE, allParams);
 
 		bootResourceAdapter(create, allParams);
 
@@ -224,8 +237,9 @@
 		//
 		authenticationService = bootAuthenticationService(create, allParams);
 		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT(authenticationService != null,
-								 "Failed to set the Authentication service for the database");
+			SanityManager.ASSERT(
+                authenticationService != null,
+                "Failed to set the Authentication service for the database");
 		}
 
 		// Lastly, let store knows that database creation is done and turn

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java Tue Apr 24 08:10:05 2007
@@ -253,10 +253,13 @@
 	 * @exception  StandardException  Standard exception policy.
      **/
     final DataValueDescriptor[] createBranchTemplate(
+    Transaction         rawtran,
     DataValueDescriptor page_ptr)
         throws StandardException
     {
-        return(TemplateRow.newBranchRow(format_ids, page_ptr));
+        return(
+            TemplateRow.newBranchRow(
+                rawtran, format_ids, collation_ids, page_ptr));
     }
 
 
@@ -278,13 +281,16 @@
      *
 	 * @exception  StandardException  Standard exception policy.
      **/
-    final public DataValueDescriptor[] createTemplate()
+    final public DataValueDescriptor[] createTemplate(
+    Transaction rawtran)
         throws StandardException
     {
         if (SanityManager.DEBUG)
             SanityManager.ASSERT(format_ids != null);
 
-        return(TemplateRow.newRow((FormatableBitSet) null, format_ids));
+        return(TemplateRow.newRow(
+                    rawtran, 
+                    (FormatableBitSet) null, format_ids, collation_ids));
     }
 
     /**
@@ -540,7 +546,7 @@
     long        conglomId)
 		throws StandardException
     {
-        return(new OpenConglomerateScratchSpace(format_ids));
+        return(new OpenConglomerateScratchSpace(format_ids, collation_ids));
     }
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeController.java Tue Apr 24 08:10:05 2007
@@ -377,7 +377,9 @@
         boolean         reclaim_deleted_rows_attempted  = false;
 
         if (scratch_template == null)
-            scratch_template = runtime_mem.get_template();
+        {
+            scratch_template = runtime_mem.get_template(getRawTran());
+        }
 
         if (SanityManager.DEBUG)
             this.isIndexableRowConsistent(rowToInsert);
@@ -1164,7 +1166,9 @@
 		}
 
         if (scratch_template == null)
-            scratch_template = runtime_mem.get_template();
+        {
+            scratch_template = runtime_mem.get_template(getRawTran());
+        }
 
         LeafControlRow current_leaf = null;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeForwardScan.java Tue Apr 24 08:10:05 2007
@@ -234,7 +234,7 @@
                         if (row_array[ret_row_count] == null)
                         {
                             row_array[ret_row_count] = 
-                                runtime_mem.get_row_for_export();
+                                runtime_mem.get_row_for_export(getRawTran());
                         }
 
                         fetch_row = row_array[ret_row_count];
@@ -242,7 +242,8 @@
                     else
                     {
                         // get a brand new row.
-                        fetch_row = runtime_mem.get_row_for_export(); 
+                        fetch_row = 
+                            runtime_mem.get_row_for_export(getRawTran()); 
                     }
                 }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java Tue Apr 24 08:10:05 2007
@@ -262,7 +262,8 @@
         throws StandardException
     {
         DataValueDescriptor[] shrink_key = 
-            open_btree.getConglomerate().createTemplate();
+            open_btree.getConglomerate().createTemplate(
+                    open_btree.getRawTran());
 
         control_row.page.fetchFromSlot(
             (RecordHandle) null,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java Tue Apr 24 08:10:05 2007
@@ -1207,7 +1207,8 @@
 
 		this.init_hold                  = hold;
 
-		this.init_template              = runtime_mem.get_template();
+		this.init_template              = 
+            runtime_mem.get_template(getRawTran());
 
         this.init_scanColumnList        = scanColumnList;
 
@@ -1729,7 +1730,7 @@
 		throws StandardException
 	{
         // Turn this call into a group fetch of a 1 element group.
-        fetchNext_one_slot_array[0] = runtime_mem.get_scratch_row();
+        fetchNext_one_slot_array[0] = runtime_mem.get_scratch_row(getRawTran());
         boolean ret_val = 
             fetchRows(
                 scan_position,
@@ -2313,7 +2314,7 @@
                     if (reposition(scan_position, false))
                     {
                         scan_position.current_positionKey = 
-                            runtime_mem.get_row_for_export();
+                            runtime_mem.get_row_for_export(getRawTran());
 
 
                         Page page = scan_position.current_leaf.getPage();
@@ -2438,7 +2439,7 @@
                     scan_position.current_rh.getPageNumber())
             {
                 scan_position.current_positionKey = 
-                    runtime_mem.get_row_for_export();
+                    runtime_mem.get_row_for_export(getRawTran());
 
                 RecordHandle rh =
                     page.fetchFromSlot(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchControlRow.java Tue Apr 24 08:10:05 2007
@@ -413,7 +413,10 @@
             // Find the child page for the shrink key.
 
             BranchRow branch_template =
-                BranchRow.createEmptyTemplate(open_btree.getConglomerate());
+                BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
+                    open_btree.getConglomerate());
+
             SearchParameters sp = new SearchParameters(
                 shrink_key,
                 SearchParameters.POSITION_LEFT_OF_PARTIAL_KEY_MATCH,
@@ -666,7 +669,9 @@
 
             // Read in the branch row which is at the split point.
             BranchRow split_branch_row =
-                BranchRow.createEmptyTemplate(open_btree.getConglomerate());
+                BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
+                    open_btree.getConglomerate());
 
             this.page.fetchFromSlot(
                 (RecordHandle) null, splitpoint, split_branch_row.getRow(), 
@@ -735,7 +740,9 @@
             newbranchrow.setPageNumber(newbranch.page.getPageNumber());
 
             BranchRow branch_template =
-                BranchRow.createEmptyTemplate(open_btree.getConglomerate());
+                BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
+                    open_btree.getConglomerate());
 			SearchParameters sp = new SearchParameters(
                 newbranchrow.getRow(),
                 SearchParameters.POSITION_LEFT_OF_PARTIAL_KEY_MATCH,
@@ -883,7 +890,10 @@
 
         // RESOLVE (mikem) - should this be passed in?
         BranchRow branch_template =
-            BranchRow.createEmptyTemplate(open_btree.getConglomerate());
+            BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
+                    open_btree.getConglomerate());
+
 		SearchParameters sp = new SearchParameters(
             splitrow, 
             SearchParameters.POSITION_LEFT_OF_PARTIAL_KEY_MATCH,
@@ -1513,6 +1523,7 @@
 		throws StandardException
     {
         return(BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
                     open_btree.getConglomerate()).getRow());
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BranchRow.java Tue Apr 24 08:10:05 2007
@@ -28,8 +28,10 @@
 import org.apache.derby.iapi.store.access.RowUtil;
 
 import org.apache.derby.iapi.store.raw.ContainerHandle;
+import org.apache.derby.iapi.store.raw.Transaction;
 
 import org.apache.derby.iapi.types.DataValueDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
 import org.apache.derby.iapi.types.SQLLongint;
 
 /**
@@ -78,13 +80,15 @@
 	{
 	}
 
-	private BranchRow(BTree btree)
+	private BranchRow(
+    Transaction         rawtran,
+    BTree               btree)
         throws StandardException
 	{
         SQLLongint child_page  = 
             new SQLLongint(ContainerHandle.INVALID_PAGE_NUMBER);
 
-        branchrow   = btree.createBranchTemplate(child_page);
+        branchrow   = btree.createBranchTemplate(rawtran, child_page);
 
         if (SanityManager.DEBUG)
         {
@@ -126,12 +130,12 @@
      *
      * @exception StandardException Standard exception policy.
      */
-    public static BranchRow createEmptyTemplate(BTree   btree)
+    public static BranchRow createEmptyTemplate(
+    Transaction         rawtran,
+    BTree               btree)
         throws StandardException
     {
-        BranchRow  newbranch   = new BranchRow(btree);
-
-        return(new BranchRow(btree));
+        return(new BranchRow(rawtran, btree));
     }
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java Tue Apr 24 08:10:05 2007
@@ -2037,7 +2037,8 @@
     public DataValueDescriptor[] getRowTemplate(OpenBTree    open_btree)
 		throws StandardException
     {
-        return(open_btree.getConglomerate().createTemplate());
+        return(open_btree.getConglomerate().createTemplate(
+                    open_btree.getRawTran()));
     }
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/LeafControlRow.java Tue Apr 24 08:10:05 2007
@@ -596,7 +596,8 @@
         // Save away current split point leaf row, and build a branch row
         // based on it.
         DataValueDescriptor[] split_leaf_row = 
-            open_btree.getConglomerate().createTemplate();
+            open_btree.getConglomerate().createTemplate(
+                    open_btree.getRawTran());
 
         this.page.fetchFromSlot(
             (RecordHandle) null, splitpoint, split_leaf_row, 
@@ -722,7 +723,10 @@
 
 
         BranchRow branch_template = 
-            BranchRow.createEmptyTemplate(open_btree.getConglomerate());
+            BranchRow.createEmptyTemplate(
+                    open_btree.getRawTran(),
+                    open_btree.getConglomerate());
+
         SearchParameters sp = 
             new SearchParameters(
                 branchrow.getRow(),

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/OpenBTree.java Tue Apr 24 08:10:05 2007
@@ -438,7 +438,9 @@
         this.runtime_mem    = 
             (dynamic_info != null ? 
              ((OpenConglomerateScratchSpace) dynamic_info) : 
-             new OpenConglomerateScratchSpace(conglomerate.format_ids));
+             new OpenConglomerateScratchSpace(
+                 conglomerate.format_ids, 
+                 conglomerate.collation_ids));
 
 	}
 
@@ -516,7 +518,7 @@
         if (SanityManager.DEBUG)
         {
             DataValueDescriptor[] template = 
-                this.init_conglomerate.createTemplate();
+                this.init_conglomerate.createTemplate(getRawTran());
 
             // RESOLVE - could just compare format id's rather than allocate
             // objects.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IUndo.java Tue Apr 24 08:10:05 2007
@@ -144,10 +144,10 @@
                 SanityManager.ASSERT(btree instanceof B2I);
 
             // create a template for the logged index row from the conglomerate.
-            logged_index_row_template = btree.createTemplate();
+            logged_index_row_template = btree.createTemplate(rawtran);
 
             // create a template for the page index row from the conglomerate.
-            template                  = btree.createTemplate();
+            template                  = btree.createTemplate(rawtran);
         }
         finally
         {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java Tue Apr 24 08:10:05 2007
@@ -308,7 +308,8 @@
         // so allocating it here is probably not that bad.
         init_fetchDesc = 
             new FetchDescriptor(
-              (open_conglom.getRuntimeMem().get_scratch_row()).length,
+              (open_conglom.getRuntimeMem().get_scratch_row(
+                    open_conglom.getRawTran())).length,
               init_scanColumnList,
               init_qualifier);
 
@@ -660,7 +661,8 @@
                         if (row_array[ret_row_count] == null)
                         {
                             row_array[ret_row_count] = 
-                              open_conglom.getRuntimeMem().get_row_for_export();
+                              open_conglom.getRuntimeMem().get_row_for_export(
+                                  open_conglom.getRawTran());
                         }
 
                         fetch_row = row_array[ret_row_count];
@@ -668,7 +670,8 @@
                     else
                     {
                         fetch_row = 
-                            open_conglom.getRuntimeMem().get_row_for_export();
+                            open_conglom.getRuntimeMem().get_row_for_export(
+                                open_conglom.getRawTran());
                     }
                 }
 
@@ -1421,7 +1424,8 @@
         }
 
         DataValueDescriptor row[] = 
-            open_conglom.getRuntimeMem().get_scratch_row();
+            open_conglom.getRuntimeMem().get_scratch_row(
+                open_conglom.getRawTran());
 
         // If fetchFromSlot returns null it either means the row is deleted,
         // or the qualifier evaluates to false.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java Tue Apr 24 08:10:05 2007
@@ -744,7 +744,8 @@
 
             // get a template.
 
-            DataValueDescriptor[] row = runtime_mem.get_row_for_export();
+            DataValueDescriptor[] row = 
+                runtime_mem.get_row_for_export(getRawTran());
 
             // Print pages of the heap.
             Page page = container.getFirstPage();
@@ -803,6 +804,7 @@
     ContainerHandle                 open_container,
     Conglomerate                    conglomerate,
     int[]                           format_ids,
+    int[]                           collation_ids,
     TransactionManager              xact_manager,
     Transaction                     rawtran,
     boolean                         hold,
@@ -828,7 +830,7 @@
         this.runtime_mem    = 
             (dynamic_info != null ? 
              ((OpenConglomerateScratchSpace) dynamic_info) : 
-             new OpenConglomerateScratchSpace(format_ids));
+             new OpenConglomerateScratchSpace(format_ids, collation_ids));
 
         // Is this an open for update or read?  This will
 		// be passed down to the raw store fetch methods, which allows

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerateScratchSpace.java Tue Apr 24 08:10:05 2007
@@ -26,6 +26,8 @@
 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;
 import org.apache.derby.iapi.store.access.RowUtil;
 
+import org.apache.derby.iapi.store.raw.Transaction;
+
 import org.apache.derby.iapi.types.DataValueDescriptor;
 
 import org.apache.derby.iapi.services.io.FormatableBitSet;
@@ -75,15 +77,18 @@
      * A complete array of format id's for this conglomerate.
      **/
     private int[]    format_ids;
+    private int[]    collation_ids;
 
     /**************************************************************************
      * Constructors for This class:
      **************************************************************************
      */
     public OpenConglomerateScratchSpace(
-    int[]  format_ids)
+    int[]   format_ids,
+    int[]   collation_ids)
     {
-        this.format_ids = format_ids;
+        this.format_ids     = format_ids;
+        this.collation_ids  = collation_ids;
     }
 
     /**************************************************************************
@@ -108,7 +113,7 @@
      *
 	 * @exception  StandardException  Standard exception policy.
      **/
-    public DataValueDescriptor[] get_row_for_export()
+    public DataValueDescriptor[] get_row_for_export(Transaction rawtran)
         throws StandardException
     {
         // Create a partial row class template template from the initial scan
@@ -116,7 +121,9 @@
         if (row_for_export_template == null)
         {
             row_for_export_template = 
-                RowUtil.newTemplate(row_for_export_column_list, format_ids);
+                RowUtil.newTemplate(
+                    rawtran.getDataValueFactory(), 
+                    row_for_export_column_list, format_ids, collation_ids);
         }
 
         // Allocate a new row based on the class template.
@@ -137,14 +144,14 @@
      *
 	 * @exception  StandardException  Standard exception policy.
      **/
-    public DataValueDescriptor[] get_scratch_row()
+    public DataValueDescriptor[] get_scratch_row(Transaction    rawtran)
         throws StandardException
     {
         // Create a partial row class template template from the initial scan
         // parameters.
         if (scratch_row == null)
         {
-            scratch_row = get_row_for_export();
+            scratch_row = get_row_for_export(rawtran);
         }
 
         // Allocate a new row based on the class template.
@@ -162,14 +169,16 @@
      *
 	 * @exception  StandardException  Standard exception policy.
      **/
-    public DataValueDescriptor[] get_template()
+    public DataValueDescriptor[] get_template(Transaction rawtran)
         throws StandardException
     {
         // Create a partial row class template from the initial scan parameters.
         if (scratch_template == null)
         {
             scratch_template = 
-                TemplateRow.newRow((FormatableBitSet) null, format_ids);
+                TemplateRow.newRow(
+                    rawtran, 
+                    (FormatableBitSet) null, format_ids, collation_ids);
         }
 
         return(scratch_template);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java Tue Apr 24 08:10:05 2007
@@ -28,9 +28,13 @@
 import org.apache.derby.iapi.services.io.Storable;
 
 import org.apache.derby.iapi.error.StandardException;
+
 import org.apache.derby.iapi.store.access.RowUtil;
 
+import org.apache.derby.iapi.store.raw.Transaction;
+
 import org.apache.derby.iapi.types.DataValueDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
 
 import org.apache.derby.iapi.types.SQLLongint;
 
@@ -65,9 +69,11 @@
 	 * @exception  StandardException  Standard exception policy.
      **/
     private static DataValueDescriptor[] allocate_objects(
+    Transaction         rawtran,
     int                 num_cols_to_allocate,
     FormatableBitSet    column_list,
-    int[]               format_ids)
+    int[]               format_ids,
+    int[]               collation_ids)
 		throws StandardException
     {
         int         dest_pos = 0;
@@ -77,6 +83,8 @@
         int         num_cols = 
             (column_list == null ? format_ids.length : column_list.size());
 
+        DataValueFactory dvf = rawtran.getDataValueFactory();
+
         for (int i = 0; i < num_cols; i++)
         {
             // does caller want this column?
@@ -89,8 +97,7 @@
                 // yes - create the column 
 
                 // get empty instance of object identified by the format id.
-                ret_row[i] = (DataValueDescriptor) 
-                    Monitor.newInstanceFromIdentifier(format_ids[i]);
+                ret_row[i] = dvf.getNull(format_ids[i], collation_ids[i]);
 
                 if (SanityManager.DEBUG)
                 {
@@ -99,12 +106,12 @@
                     if (o == null)
                     {
                         SanityManager.THROWASSERT(
-                        "obj from Monitor.newInstanceFromIdentifier() null." +
+                        "obj from DataValueFactory.newNull(" +
+                        format_ids[i] + ", " + collation_ids[i] + ") null." +
                         ";src column position = "  + i              +
                         ";dest column position = " + i  + 
                         ";num_cols = "             + num_cols       +
                         ";format_ids.length = "    + format_ids.length);
-
                     }
 
                     if ( ! (o instanceof Storable))
@@ -186,11 +193,16 @@
 	 * @exception  StandardException  Standard exception policy.
      **/
     public static DataValueDescriptor[] newRow(
+    Transaction          rawtran,
     FormatableBitSet     column_list,
-    int[]        format_ids) 
+    int[]                format_ids,
+    int[]                collation_ids) 
         throws StandardException
     {
-        return(allocate_objects(format_ids.length, column_list, format_ids));
+        return(
+            allocate_objects(
+                rawtran, format_ids.length, column_list, 
+                format_ids, collation_ids));
     }
 
     /**
@@ -212,7 +224,9 @@
 	 * @exception  StandardException  Standard exception policy.
      **/
     public static DataValueDescriptor[] newBranchRow(
+    Transaction         rawtran,
     int[]               format_ids,
+    int[]               collation_ids,
     DataValueDescriptor page_ptr) 
         throws StandardException
     {
@@ -221,7 +235,9 @@
         // the page pointer in the branch row.
         DataValueDescriptor[] columns = 
             allocate_objects(
-                format_ids.length + 1, (FormatableBitSet) null, format_ids);
+                rawtran,
+                format_ids.length + 1, 
+                (FormatableBitSet) null, format_ids, collation_ids);
 
         // tack on the page pointer to the extra column allocated onto the 
         // end of the row built from a leafrow template.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java Tue Apr 24 08:10:05 2007
@@ -583,7 +583,7 @@
     long        conglomId)
 		throws StandardException
     {
-        return(new OpenConglomerateScratchSpace(format_ids));
+        return(new OpenConglomerateScratchSpace(format_ids, collation_ids));
     }
 
     /**
@@ -687,6 +687,7 @@
                 (ContainerHandle) null,
                 this,
                 this.format_ids,
+                this.collation_ids,
                 xact_manager,
                 rawtran,
                 hold,
@@ -748,6 +749,7 @@
                 (ContainerHandle) null,
                 this,
                 this.format_ids,
+                this.collation_ids,
                 xact_manager,
                 rawtran,
                 hold,
@@ -796,6 +798,7 @@
                     (ContainerHandle) null,
                     this,
                     this.format_ids,
+                    this.collation_ids,
                     xact_manager,
                     rawtran,
                     false,
@@ -828,6 +831,7 @@
                 (ContainerHandle) null,
                 this,
                 this.format_ids,
+                this.collation_ids,
                 nested_xact,
                 nested_xact.getRawStoreXact(),
                 true,
@@ -920,6 +924,7 @@
                     (ContainerHandle) null,
                     this,
                     this.format_ids,
+                    this.collation_ids,
                     xact_manager,
                     rawtran,
                     false,
@@ -974,6 +979,7 @@
                 (ContainerHandle) null,
                 this,
                 this.format_ids,
+                this.collation_ids,
                 xact_manager,
                 rawtran,
                 hold,
@@ -1032,6 +1038,7 @@
                 (ContainerHandle) null,
                 this,
                 this.format_ids,
+                this.collation_ids,
                 xact_manager,
                 rawtran,
                 false,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCompressScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCompressScan.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCompressScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapCompressScan.java Tue Apr 24 08:10:05 2007
@@ -182,7 +182,8 @@
                     if (row_array[ret_row_count] == null)
                     {
                         row_array[ret_row_count] = 
-                          open_conglom.getRuntimeMem().get_row_for_export();
+                          open_conglom.getRuntimeMem().get_row_for_export(
+                              open_conglom.getRawTran());
                     }
 
                     fetch_row = row_array[ret_row_count];

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapController.java Tue Apr 24 08:10:05 2007
@@ -350,6 +350,7 @@
                 (ContainerHandle) null,
                 heap,
                 heap.format_ids,
+                heap.collation_ids,
                 xact_manager,
                 xact_manager.getRawStoreXact(),
                 false,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/HeapScan.java Tue Apr 24 08:10:05 2007
@@ -260,7 +260,9 @@
         // We could optimize this, if there are no qualifiers and read
         // into a zero column row, but callers should be using fetchNext()
         // instead.
-        fetchNext_one_slot_array[0] = open_conglom.getRuntimeMem().get_scratch_row();
+        fetchNext_one_slot_array[0] = 
+            open_conglom.getRuntimeMem().get_scratch_row(
+                    open_conglom.getRawTran());
 
         boolean ret_val = 
             fetchRows(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/InternalXact.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/InternalXact.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/InternalXact.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/InternalXact.java Tue Apr 24 08:10:05 2007
@@ -33,6 +33,8 @@
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
+import org.apache.derby.iapi.types.DataValueFactory;
+
 import java.io.ObjectInput;
 
 /**
@@ -48,11 +50,14 @@
 	*/
 
 	protected InternalXact(
-    XactFactory     xactFactory, 
-    LogFactory      logFactory, 
-    DataFactory     dataFactory) 
+    XactFactory         xactFactory, 
+    LogFactory          logFactory, 
+    DataFactory         dataFactory,
+    DataValueFactory    dataValueFactory) 
     {
-		super(xactFactory, logFactory, dataFactory, false, null);
+		super(
+            xactFactory, logFactory, dataFactory, dataValueFactory, 
+            false, null);
 
 		// always want to hold latches & containers open past the commit/abort
 		setPostComplete();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java Tue Apr 24 08:10:05 2007
@@ -29,6 +29,7 @@
 import org.apache.derby.iapi.services.daemon.Serviceable;
 import org.apache.derby.iapi.services.locks.LockFactory;
 import org.apache.derby.iapi.services.locks.Limit;
+import org.apache.derby.iapi.services.monitor.Monitor;
 
 import org.apache.derby.iapi.store.raw.ContainerHandle;
 import org.apache.derby.iapi.store.raw.Compensation;
@@ -54,6 +55,8 @@
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.error.ExceptionSeverity;
 
+import org.apache.derby.iapi.types.DataValueFactory;
+
 import org.apache.derby.iapi.services.property.PersistentSet;
 
 import org.apache.derby.catalog.UUID;
@@ -166,10 +169,11 @@
 	protected	XactContext		xc;	// my context - set by XactContext
 
 	// these fields remain fixed for the lifetime of this object
-	protected final XactFactory		xactFactory;
-	protected final DataFactory		dataFactory;
-	protected final LogFactory		logFactory;
-	private final CompatibilitySpace compatibilitySpace;
+	protected final XactFactory		    xactFactory;
+	protected final DataFactory		    dataFactory;
+	protected final LogFactory		    logFactory;
+    protected final DataValueFactory    dataValueFactory;
+	private   final CompatibilitySpace  compatibilitySpace;
 
 	// these fields remain fixedfor the lifetime
 	private LockingPolicy defaultLocking;
@@ -255,19 +259,21 @@
 	*/
 
 	protected Xact(
-    XactFactory xactFactory, 
-    LogFactory  logFactory, 
-    DataFactory dataFactory,
-    boolean     readOnly,
-    CompatibilitySpace compatibilitySpace)
+    XactFactory         xactFactory, 
+    LogFactory          logFactory, 
+    DataFactory         dataFactory,
+    DataValueFactory    dataValueFactory,
+    boolean             readOnly,
+    CompatibilitySpace  compatibilitySpace)
     {
 
 		super();
 
-		this.xactFactory = xactFactory;
-		this.logFactory  = logFactory;
-		this.dataFactory = dataFactory;
-		this.readOnly    = readOnly;
+		this.xactFactory        = xactFactory;
+		this.logFactory         = logFactory;
+		this.dataFactory        = dataFactory;
+		this.dataValueFactory   = dataValueFactory;
+		this.readOnly           = readOnly;
 
 		if (compatibilitySpace == null) {
 			this.compatibilitySpace =
@@ -2686,6 +2692,26 @@
 		
 		return toString();
 	}
+
+    /**
+     * Get DataValueFactory.
+     * <p>
+     * Return a DataValueFactory that can be used to allocate objects.  Used
+     * to make calls to: 
+     *     DataValueFactory.getInstanceUsingFormatIdAndCollationType()
+     *
+	 * @return a booted data value factory.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+    public DataValueFactory getDataValueFactory()
+		throws StandardException
+    {
+        return((DataValueFactory) 
+            Monitor.findServiceModule(
+                xactFactory,
+                org.apache.derby.iapi.reference.ClassName.DataValueFactory));
+    }
 
 
 	/* package */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java Tue Apr 24 08:10:05 2007
@@ -57,13 +57,15 @@
 import org.apache.derby.iapi.store.raw.log.LogFactory;
 import org.apache.derby.iapi.store.raw.log.LogInstant;
 
-import org.apache.derby.iapi.store.raw.xact.TransactionFactory;
 import org.apache.derby.iapi.store.raw.xact.RawTransaction;
+import org.apache.derby.iapi.store.raw.xact.TransactionFactory;
 import org.apache.derby.iapi.store.raw.xact.TransactionId;
+import org.apache.derby.impl.store.raw.xact.XactXAResourceManager;
+
+import org.apache.derby.iapi.types.DataValueFactory;
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.impl.store.raw.xact.XactXAResourceManager;
 
 import java.util.Enumeration;
 import java.util.Properties;
@@ -90,6 +92,7 @@
 	protected LockFactory           lockFactory;
 	protected LogFactory            logFactory;
 	protected DataFactory           dataFactory;
+	protected DataValueFactory      dataValueFactory;
 	protected RawStoreFactory       rawStoreFactory;
 
 	public TransactionTable ttab;
@@ -124,7 +127,24 @@
 	{
 
 		uuidFactory = Monitor.getMonitor().getUUIDFactory();
+
+        /*
+        dataValueFactory =  (DataValueFactory)
+            Monitor.findServiceModule(
+                this,
+                org.apache.derby.iapi.reference.ClassName.DataValueFactory);
+        */
+            // if datafactory has not been booted yet, try now.  This can
+            // happen in the unit tests.  Usually it is booted before store
+            // booting is called.
+            dataValueFactory = (DataValueFactory) 
+                Monitor.bootServiceModule(
+                    create, 
+                    this,
+                    org.apache.derby.iapi.reference.ClassName.DataValueFactory, 
+                    properties);
 		
+
 		contextFactory = ContextService.getFactory();
 
 		lockFactory = 
@@ -269,7 +289,9 @@
 		}
 
 		Xact xact = 
-            new Xact(this, logFactory, dataFactory, readOnly, compatibilitySpace);
+            new Xact(
+                this, logFactory, dataFactory, dataValueFactory, 
+                readOnly, compatibilitySpace);
 
         xact.setTransName(transName);
 		pushTransactionContext(cm, xact_context_id, xact,
@@ -376,7 +398,8 @@
 		}
 
 		Xact xact = 
-            new Xact(this, logFactory, dataFactory, false, null);
+            new Xact(
+                this, logFactory, dataFactory, dataValueFactory, false, null);
 
 		// hold latches etc. past commit in NTT
 		xact.setPostComplete();
@@ -398,7 +421,9 @@
 		}
 
 
-		Xact xact = new InternalXact(this, logFactory, dataFactory);
+		Xact xact = 
+            new InternalXact(this, logFactory, dataFactory, dataValueFactory);
+
 		pushTransactionContext(cm, INTERNAL_CONTEXT_ID, xact, 
 							   true /* abortAll*/,
 							   rsf,

Modified: db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/NoOpTransaction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/NoOpTransaction.java?view=diff&rev=531971&r1=531970&r2=531971
==============================================================================
--- db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/NoOpTransaction.java (original)
+++ db/derby/code/trunk/java/storeless/org/apache/derby/impl/storeless/NoOpTransaction.java Tue Apr 24 08:10:05 2007
@@ -47,6 +47,7 @@
 import org.apache.derby.iapi.store.access.TransactionController;
 import org.apache.derby.iapi.store.raw.Loggable;
 import org.apache.derby.iapi.types.DataValueDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
 
 /**
  * A TransactionController that does nothing.
@@ -414,6 +415,10 @@
     public Properties getProperties() throws StandardException {
         // TODO Auto-generated method stub
         return null;
+    }
+    public DataValueFactory getDataValueFactory() throws StandardException {
+        // TODO Auto-generated method stub
+        return(null);
     }
 
 }



Mime
View raw message