You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2005/07/01 19:28:54 UTC

svn commit: r208776 [1/7] - in /incubator/derby/code/branches/10.1: ./ java/client/org/apache/derby/client/am/ java/demo/simple/ java/engine/org/apache/derby/diag/ java/engine/org/apache/derby/iapi/jdbc/ java/engine/org/apache/derby/impl/load/ java/eng...

Author: fuzzylogic
Date: Fri Jul  1 10:28:49 2005
New Revision: 208776

URL: http://svn.apache.org/viewcvs?rev=208776&view=rev
Log:
In preperation for the 10.1 release, roll up fixes from trunk.

Includes fixes for DERBY-8, DERBY-247, DERBY-276, DERBY-348, DERBY-354,
DERBY-361, DERBY-366, DERBY-389, DERBY-405, DERBY-416, and DERBY-420

Added:
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/
      - copied from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/updatableResultSet.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/updatableResultSet.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xaSimplePositive.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xaSimplePositive.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/caseI_tr_TR.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/caseI_tr_TR.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/updatableResultSet.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/updatableResultSet.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec1.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec1.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec2.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec2.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec3.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec3.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec4.out
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/oc_rec4.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec1.java
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec1.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec2.java
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec2.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec3.java
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec3.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec4.java
      - copied unchanged from r208649, incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec4.java
Removed:
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive_app.properties
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive_sed.properties
Modified:
    incubator/derby/code/branches/10.1/STATUS
    incubator/derby/code/branches/10.1/build.xml
    incubator/derby/code/branches/10.1/java/client/org/apache/derby/client/am/ResultSet.java
    incubator/derby/code/branches/10.1/java/demo/simple/example.html
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/diag/ErrorMessages.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ColumnInfo.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportResultSetForObject.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/Import.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocExtent.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/CompressSpacePageOperation.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/PhysicalUndoOperation.java
    incubator/derby/code/branches/10.1/java/engine/org/apache/derby/loc/messages_en.properties
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/synonym.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ver2.6/parameterMapping.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/synonym.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/updatableResultSet.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/I18NImportExport.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/UnicodeEscape_JP.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests_ES.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/jdk14/updatableResultSet.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/synonym.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/storerecovery.runall
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/UnicodeEscape_JP.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/synonym.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/BaseTest.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql
    incubator/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
    incubator/derby/code/branches/10.1/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
    incubator/derby/code/branches/10.1/tools/javadoc/publishedapi.ant

Modified: incubator/derby/code/branches/10.1/STATUS
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/STATUS?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/STATUS (original)
+++ incubator/derby/code/branches/10.1/STATUS Fri Jul  1 10:28:49 2005
@@ -49,6 +49,7 @@
 Committers      mikem     Mike Matrigali (CLA on file)
 Committers      mcintyre  Samuel McIntyre (CLA on file)
 Committers      coar      Ken Coar (CLA on file)
+Committers                Tomohito Nakayama (CLA on file)
 
 Completed tasks are shown by the completion date (YYYY-MM-dd).
 Incubation status reports
@@ -207,6 +208,10 @@
 
   Passed with three +1 votes.
 
+[VOTE] to accept Tomohito Nakayama as a committer
+  Passed with +1 votes from Jeremy Boynes, Jean T Anderson,
+  Satheesh Bandaram, Brian McAllister, Mike Matrigali,
+  Andrew McIntyre, Kathey Marsden
 
 OTHER NEWS
 ==========

Modified: incubator/derby/code/branches/10.1/build.xml
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/build.xml?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/build.xml (original)
+++ incubator/derby/code/branches/10.1/build.xml Fri Jul  1 10:28:49 2005
@@ -533,6 +533,12 @@
                includesfile="${javadoctools.dir}/publishedapi.ant"/>
     </copy>
 
+    <!-- client files -->
+    <copy todir="${out.javadoc.dir}/sourcedir">
+      <fileset dir="${derby.client.src.dir}"
+               includesfile="${javadoctools.dir}/publishedapi.ant"/>
+    </copy>
+
     <javadoc sourcepath="${out.javadoc.dir}/sourcedir"
              classpath="${compile.classpath};${osgi};${servlet24};${out.dir}"
              breakiterator="true"
@@ -541,7 +547,7 @@
              Windowtitle="Apache Derby ${major}.${minor} API Documentation"
              Doctitle="Apache Derby ${major}.${minor} API Documentation"
              Footer="${javadoc.Footer}"
-             bottom="Apache Derby ${major}.${minor} API Documentation  -  &lt;i&gt;Copyright &amp;copy; 1997,2004 The Apache Software Foundation or its licensors, as applicable.&lt;/i&gt;"/>
+             bottom="Apache Derby ${major}.${minor} API Documentation  -  &lt;i&gt;Copyright &amp;copy; 1997,2005 The Apache Software Foundation or its licensors, as applicable.&lt;/i&gt;"/>
 
     <delete dir="${out.javadoc.dir}/sourcedir"/>
 
@@ -563,7 +569,7 @@
         windowtitle="Apache Derby V${major}.${minor} Engine Documentation"
         doctitle="Apache Derby V${major}.${minor} Engine Documentation"
         Footer="${javadoc.Footer}"
-        bottom="Apache Derby V${major}.${minor} Engine Documentation - &lt;i&gt;Copyright &amp;copy; 1997,2004 The Apache Software Foundation or its licensors, as applicable.&lt;/i&gt;"
+        bottom="Apache Derby V${major}.${minor} Engine Documentation - &lt;i&gt;Copyright &amp;copy; 1997,2005 The Apache Software Foundation or its licensors, as applicable.&lt;/i&gt;"
         source="1.4">
         <taglet name="org.apache.derbyBuild.javadoc.FormatIdTaglet" 
                 path="${basedir}/classes"/>

Modified: incubator/derby/code/branches/10.1/java/client/org/apache/derby/client/am/ResultSet.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/client/org/apache/derby/client/am/ResultSet.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/client/org/apache/derby/client/am/ResultSet.java (original)
+++ incubator/derby/code/branches/10.1/java/client/org/apache/derby/client/am/ResultSet.java Fri Jul  1 10:28:49 2005
@@ -1804,17 +1804,50 @@
         // discard all previous updates when moving the cursor.
         resetUpdatedColumns();
 
-        // this method may only be called when the cursor on a valid row,
-        // not after the last row, before the first row, or on the insert row.
-        // throw exception if result set contains no rows, because there is no current row.
-        if (isBeforeFirstX() || isAfterLastX() || isOnInsertRow_ || resultSetContainsNoRows()) {
+        // this method may not be called when the cursor on the insert row
+        if (isOnInsertRow_) {
             throw new SqlException(agent_.logWriter_, "Cursor is Not on a Valid Row");
         }
 
+        // If the resultset is empty, relative(n) is a null operation
+        if (resultSetContainsNoRows()) {
+            isValidCursorPosition_ = false;
+            return isValidCursorPosition_;
+        }
+        
+        // relative(0) is a null-operation, but the retruned result is
+        // dependent on wether the cursorposition is on a row or not.
         if (rows == 0) {
-            isValidCursorPosition_ = true;
+            if (isBeforeFirstX() || isAfterLastX()) {
+                isValidCursorPosition_ = false;
+            } else {
+                isValidCursorPosition_ = true;
+            }
             return isValidCursorPosition_;
         }
+
+        // Handle special cases when the cursor is before first or
+        // after last, since the following code assumes we ar on a
+        // valid cursor
+        if (isBeforeFirstX()) {
+            if (rows > 0) {
+                nextX();
+                return relativeX(rows-1);
+            } else {
+                isValidCursorPosition_ = false;
+                return isValidCursorPosition_;
+            }
+        }
+        if (isAfterLastX()) {
+            if (rows < 0) {
+                previousX();
+                return relativeX(rows+1);
+            } else {
+                isValidCursorPosition_ = false;
+                return isValidCursorPosition_;
+            }
+        }
+        // Ok, now we are on a row and ready to do some real positioning.....
 
         resetRowsetFlags();
 

Modified: incubator/derby/code/branches/10.1/java/demo/simple/example.html
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/demo/simple/example.html?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/demo/simple/example.html (original)
+++ incubator/derby/code/branches/10.1/java/demo/simple/example.html Fri Jul  1 10:28:49 2005
@@ -2,9 +2,7 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<meta name="GENERATOR" content="Quadralay WebWorks Publisher 5.0.4">
-<meta name="TEMPLATEBASE" content="Dynamic HTML">
-<meta name="LASTUPDATED" content="06/25/02 12:10:42">
+<meta name="LASTUPDATED" content="06/15/05 12:10:42">
 <link rel="StyleSheet" href="../../csfull.css" type="text/css" media="screen">
 <title>Simple JDBC Application</title>
 
@@ -45,14 +43,18 @@
  
 
 <ul class="ChapterTOC">  <li class="ChapterTOC"><a name="820053"> </a>  <a href="#820067">Overview</a>
-  <li class="ChapterTOC"><a name="820061"> </a>  <a href="#816689">What's Included?</a>
-  <li class="ChapterTOC"><a name="820065"> </a>  <a href="#816722">How to Run This Sample Application in an Embedded Environment</a>
+  <li class="ChapterTOC">  <a href="#816689">What's Included?</a>
+  <li class="ChapterTOC">  <a href="#816722">How to run this sample application in an embedded environment</a>
+<li class="ChapterTOC">  <a href="#816723">How to run this sample application in a server environment</a>
 </ul>
 <h2 class="Heading2"><a name="820067"> </a>Overview
 </h2>
  <p class="Body">
-  <a name="820012"> </a>This example program is a very minimal JDBC application. JDBC is the primary API for interacting with Apache Derby. This program accomplishes the following tasks:
-</p><ul class="Normal">  <li class="Normal"><a name="817266"> </a>starts up the  Derby engine, if necessary
+  <a name="820012"> </a>This example program is a very minimal JDBC application. JDBC is the primary API for interacting with Apache Derby. This program:
+</p><ul class="Normal">  
+  <li class="Normal">runs in either embedded mode (the default) or as a client in a server environment, depending on the arguments passed to the program.
+  <li class="Normal"><a name="817266"> </a>starts up the Derby engine, if running in embedded mode
+  <li class="Normal"><a name="817266"> </a>connects to the Derby Network Server, if running in client mode
   <li class="Normal"><a name="817275"> </a>creates and connects to a database
   <li class="Normal"><a name="817276"> </a>creates a table
   <li class="Normal"><a name="817277"> </a>inserts data
@@ -60,11 +62,14 @@
   <li class="Normal"><a name="817279"> </a>selects data
   <li class="Normal"><a name="817280"> </a>drops a table
   <li class="Normal"><a name="817281"> </a>disconnects
-  <li class="Normal"><a name="817282"> </a>shuts down Derby, if necessary
+  <li class="Normal"><a name="817282"> </a>shuts down Derby, if running in embedded mode
 </ul>
 <p class="Body">
-  <a name="817267"> </a>The application runs in an embedded environment. This is the simplest Derby environment. The application starts up an instance of Derby within the current JVM and shuts down the instance before it completes. No network access is involved. In an embedded environment, only one application at a time can access a database.
-</p><h2 class="Heading2"><a name="816689"> </a>What's Included?
+  <a name="817267"> </a>In embedded mode, the application starts up an instance of Derby within the current Java Virtual Machine and shuts down the instance before it completes. No network access is involved. Only one application can access a database at a time. 
+</p>
+<p>In a server environment, the application demonstrates the use of the Derby network client or the IBM DB2 JDBC Universal Driver by connecting to the Network Server and running the demo. Note that the client drivers allow multiple instances of the application to run at the same time.  However, the SQL operations performed by this demo will cause failures when multiple simultaneous instances of the application are run. Use of a client driver to connect to the Network Server in this application is intended only to demonstrate this type of connection. The SimpleApp demo is not suited for simultaneous executions because it creates and drops the table on which it operates.
+</p>
+<h2 class="Heading2"><a name="816689"> </a>What's Included?
 </h2>
  <p class="Body">
   <a name="816691"> </a>Before running this demo, you should see the following files and directories in the <em class="fileName">/demo/programs/simple</em> directory:
@@ -81,7 +86,7 @@
  
 
 <p class="BodyRelative">
-  <a name="816697"> </a>Source code for the example program that starts up Derby, creates a database, does some inserts and updates, and then shuts down Derby. <em class="Emphasis">Examine this file to see how the application behaves in the various environments</em>.
+  <a name="816697"> </a>Source code for the example program that starts up Derby, creates a database, performs some inserts and updates, and then shuts down Derby. <em class="Emphasis">Examine this file to see how the application behaves in the various environments</em>.
 </p>
   <li class="Normal"><a name="816699"> </a><em class="fileName">
 <a href="derby.properties" target="_top">derby.properties</a></em>
@@ -113,7 +118,7 @@
  
 
 <p class="BodyRelative">
-  <a name="816713"> </a>The directory that holds the database log for the <em class="fileName">derbyDB</em> database. 
+  <a name="816713"> </a>The directory that holds the database transaction logs for the <em class="fileName">derbyDB</em> database. 
 </p>
   <li class="Normal"><a name="816714"> </a><em class="fileName">derbyDB\seg0</em> (directory)
 
@@ -137,27 +142,32 @@
   <a name="816720"> </a>The log file with Derby progress and error messages.
 </p>
 </ul>
-<h2 class="Heading2"><a name="816722"> </a>How to Run This Sample Application in an Embedded Environment
+<h2 class="Heading2"><a name="816722"> </a>How to run this sample application in an embedded environment
 </h2>
- <ol type="1">  <li class="Normal" value="1"><a name="816724"> </a>Open a command window and change directories to the <em class="fileName">/demo/programs/simple</em> directory.
-  <li class="Normal" value="2"><a name="816726"> </a>If you haven't set it already on a system-wide basis, set the DERBY_INSTALL environment variable to the location of the directory where you installed the Derby software in the current command window.
-  <li class="Normal" value="3"><a name="819207"> </a>In the command window, set CLASSPATH as follows:<p><table border="4" cellspacing="0" cellpadding="5" bgcolor="#FAF0E6">
+ <ol type="1">  <li class="Normal"><a name="816724"> </a>Open a command window.
+  <li class="Normal"><a name="816726"> </a>If you haven't set it already on a system-wide basis, set the DERBY_INSTALL environment variable to the location of the directory where you installed the Derby software in the current command window.
+  <li class="Normal">and change directories to the <em class="fileName">%DERBY_INSTALL%\demo\programs\simple</em> directory.
+  <li class="Normal"><a name="819207"> </a>In the command window, set the CLASSPATH as follows:
+<p>WINDOWS: set CLASSPATH=.;%DERBY_INSTALL%\lib\derby.jar<br>
+UNIX (ksh): export CLASSPATH=.:${DERBY_INSTALL}/lib/derby.jar
+</p>
+<p><table border="4" cellspacing="0" cellpadding="5" bgcolor="#FAF0E6">
   <caption class="TableTitle"></caption>
   <tr valign="bottom">
     <th><a name="819182"> </a><p class="CellHeading">Library or Directory</p></th>
     <th><a name="819184"> </a><p class="CellHeading">Path to Library or Directory</p></th>
   </tr>
   <tr valign="top">
-    <td class="DefaultTable"><a name="821049"> </a><p class="CellBody">main Derby library for the product:</p>
+    <td class="DefaultTable"><a name="821049"> </a><p class="CellBody">main Derby library:</p>
 <a name="819190"> </a><p class="CellBody"><em class="fileName">derby.jar</em></p>
 </td>
-    <td class="DefaultTable"><a name="819195"> </a><p class="CellBody"><em class="fileName">%DERBY_INSTALL%/lib/derby.jar</em></p>
+    <td class="DefaultTable"><a name="819195"> </a><p class="CellBody"><em class="fileName">%DERBY_INSTALL%\lib\derby.jar</em></p>
 </td>
   </tr>
   <tr valign="top">
-    <td class="DefaultTable"><a name="819204"> </a><p class="CellBody">current directory</p>
+    <td class="DefaultTable"><a name="819204"> </a><p class="CellBody">current directory<br>SimpleApp.class</p>
 </td>
-    <td class="DefaultTable"><a name="819206"> </a><p class="CellBody">.</p>
+    <td class="DefaultTable"><a name="819206"> </a><p class="CellBody">.\</p>
 </td>
   </tr>
 </table>
@@ -172,16 +182,16 @@
   <a name="819218"> </a><p><table border="0" cellpadding="3" cellspacing="2" bgcolor="Silver">
   <tr valign="top">
     <td class="BoxTable"><h3 class="BoxHead">
-  <a name="819210"> </a>A Note on Setting Class Path for an Embedded Environment
+  <a name="819210"> </a>A note on setting the classpath for an embedded environment
 </h3>
-<a name="819214"> </a><p class="CellBody">Derby provides a script to help you get started setting class path in <br> <em class="fileName">%DERBY_INSTALL%/frameworks/embedded/bin</em>. This script is called<em class="fileName"> setEmbeddedCP </em>and comes in two flavors: one for Windows environment (this file ends with <em class="fileName">.bat</em>) and one for UNIX environments (this file ends with <em class="fileName">.ksh</em>). For users working in those environments, copying the commands in this file will help you get started setting the class path. </p>
+<a name="819214"> </a><p class="CellBody">Derby provides a script to help you get started with setting the classpath in <br> <em class="fileName">%DERBY_INSTALL%\frameworks\embedded\bin</em>. This script is called<em class="fileName"> setEmbeddedCP </em>and comes in two flavors: one for Windows environment (this file ends with <em class="fileName">.bat</em>) and one for UNIX environments (this file ends with <em class="fileName">.ksh</em>). For users working in those environments, copying the commands in this file will help you get started setting the classpath. </p>
 </td>
   </tr>
 </table>
 </p>
 
 </p>
-  <li class="Normal" value="4"><a name="819222"> </a>Run Derby's utility for testing the class path for an embedded environment. You will provide the arguments <em class="Emphasis">embedded</em> to indicate an embedded environment and <em class="Emphasis">SimpleApp.class</em> to test for the presence of the <em class="javaObject">SimpleApp</em> class.
+  <li class="Normal"><a name="819222"> </a>Run Derby's Sysinfo utility for testing the classpath for an embedded environment. You will provide the arguments <em class="Emphasis">embedded</em> to indicate an embedded environment and <em class="Emphasis">SimpleApp.class</em> to test for the presence of the <em class="javaObject">SimpleApp</em> class.
 
  
 
@@ -200,60 +210,325 @@
 <p class="BodyRelative">
   <a name="820871"> </a>If your environment is set up correctly, the utility shows output indicating success. It looks like this:
 </p>
-<p class="OutputRelative"><a name="820884"> </a>FOUND IN CLASS PATH:</p>
+<p class="OutputRelative"><a name="820884"> </a>FOUND IN classpath:</p>
 <p class="OutputRelative"><a name="820886"> </a>  Derby embedded engine library (derby.jar)</p>
 <p class="OutputRelative"><a name="820887"> </a></p>
 <p class="OutputRelative"><a name="820893"> </a>   user-specified class (SimpleApp)</p>
-<p class="OutputRelative"><a name="820896"> </a>SUCCESS: All Derby-Related classes for embedded environment found in class path.</p>
+<p class="OutputRelative"><a name="820896"> </a>SUCCESS: All Derby-Related classes for embedded environment found in classpath.</p>
 
  
 
 <p class="BodyRelative">
-  <a name="820878"> </a>If something is missing from your class path environment, the utility indicates what is missing. For example, if you neglected to add the directory containing the SimpleApp class to your class path, the utility would indicate as such:
+  <a name="820878"> </a>If something is missing from your classpath environment, the utility indicates what is missing. For example, if you neglected to add the directory containing the SimpleApp class to your classpath, the utility would indicate as such:
 </p>
 <p class="OutputRelative"><a name="820925"> </a>Testing for presence of Derby-related libraries for embedded environment.</p>
-<p class="OutputRelative"><a name="820927"> </a>FOUND IN CLASS PATH:</p>
+<p class="OutputRelative"><a name="820927"> </a>FOUND IN classpath:</p>
 <p class="OutputRelative"><a name="820956"> </a></p>
 <p class="OutputRelative"><a name="820929"> </a>   Derby embedded engine library (derby.jar)</p>
 <p class="OutputRelative"><a name="820934"> </a></p>
-<p class="OutputRelative"><a name="820937"> </a>NOT FOUND IN CLASS PATH:</p>
+<p class="OutputRelative"><a name="820937"> </a>NOT FOUND IN classpath:</p>
 <p class="OutputRelative"><a name="820958"> </a>   user-specified class (SimpleApp)</p>
 <p class="OutputRelative"><a name="820940"> </a>    (SimpleApp not found.)</p>
-  <li class="Normal" value="5"><a name="818903"> </a>Once you have your environment set up correctly, execute the application from the same directory (<em class="fileName">/demo/programs/simple</em>): 
+  <li class="Normal"><a name="818903"> </a>Once you have your environment set up correctly, execute the application in embedded mode from the same directory (<em class="fileName">/demo/programs/simple</em>): 
 <p class="CommandLine"><a name="816737">java SimpleApp</a></p></ol>
-<p class="Body">
-  <a name="818687"> </a>A successful run produces the following output: 
-</p><p class="Output"><a name="820970"> </a>SimpleApp starting in embedded mode.
-<br>
-<a name="820971"> </a>Loaded the appropriate driver.
-<br>
-<a name="820972"> </a>Connected to and created database derbyDB
-<br>
-<a name="820973"> </a>Created table derbyDB
-<br>
-<a name="820974"> </a>Inserted 1956 Webster
-<br>
-<a name="820975"> </a>Inserted 1910 Union
-<br>
-<a name="820976"> </a>Updated 1956 Webster to 180 Grand
-<br>
-<a name="820977"> </a>Updated 180 Grand to 300 Lakeshore
-<br>
-<a name="820978"> </a>Verified the rows
-<br>
-<a name="820979"> </a>Dropped table derbyDB
-<br>
-<a name="820980"> </a>Closed result set and statement
-<br>
-<a name="820981"> </a>Committed transaction and closed connection
-<br>
-<a name="820982"> </a>Database shut down normally
-<br>
-<a name="818289"> </a>SimpleApp finished
-<br>
-</p>
 
-<p class="NavBarVersion">Apache Derby Version 10</p>
+
+<BLOCKQUOTE><A name=820970></A>SimpleApp starting in embedded mode. <BR>
+<A 
+name=820971></A>Loaded the appropriate driver. <BR>
+<A name=820972></A>Connected 
+to and created database derbyDB <BR>
+<A name=820973></A>Created table derbyDB 
+<BR>
+<A name=820974></A>Inserted 1956 Webster <BR>
+<A name=820975></A>Inserted 
+1910 Union <BR>
+<A name=820976></A>Updated 1956 Webster to 180 Grand <BR>
+<A 
+name=820977></A>Updated 180 Grand to 300 Lakeshore <BR>
+<A 
+name=820978></A>Verified the rows <BR>
+<A name=820979></A>Dropped table derbyDB 
+<BR>
+<A name=820980></A>Closed result set and statement <BR>
+<A 
+name=820981></A>Committed transaction and closed connection <BR>
+<A 
+name=820982></A>Database shut down normally <BR>
+<A name=818289></A>SimpleApp 
+finished</BLOCKQUOTE>
+
+
+
+
+<h2 class="Heading2"><a name="816723"> </a>How to run this sample application in a server environment
+</h2>
+<p>You will need to set up both the client process and the server process to run the demo application as a client connecting to the Network server.</p>
+<P><A name="Server"><B>First start the Network Server:</B></A></P>
+
+ <ol type="1">  <li class="Normal"><a name="816724"> </a>Open a command window for the server.
+  <li class="Normal"><a name="816726"> </a>If you haven't set it already on a system-wide basis, set the DERBY_INSTALL environment variable to the location of the directory where you installed the Derby software in the current command window.
+<li class="Normal">Change directories to the <em class="fileName">\demo\programs\simple</em> directory.
+  <li class="Normal"><a name="819207"> </a>In the command window for the server, set the CLASSPATH as follows:<p>
+
+<BLOCKQUOTE>WINDOWS: set CLASSPATH=.;%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbynet.jar<BR>
+UNIX (ksh): export CLASSPATH=.:${DERBY_INSTALL}/lib/derby.jar:${DERBY_INSTALL}/lib/derbynet.jar</BLOCKQUOTE>
+<BLOCKQUOTE>
+<br>
+
+<TABLE cellspacing="0" cellpadding="5" bgcolor="#faf0e6" border="4">
+  <CAPTION class=TableTitle>Classpath for the process starting the Network Server </CAPTION>
+  <TBODY>
+    <TR vAlign=bottom>
+      <TH><A name=819182></A>
+      <P class=CellHeading>Library or Directory</P>
+      </TH>
+      <TH><A name=819184></A>
+      <P class=CellHeading>Path to Library or Directory</P>
+      </TH>
+    </TR>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=821049></A>
+      <P class=CellBody>main Derby library:</P>
+      <A name=819190></A>
+      <P class=CellBody><EM class=fileName>derby.jar</EM></P>
+      </TD>
+      <TD class=DefaultTable><A name=819195></A>
+      <P class=CellBody><EM 
+        class=fileName>%DERBY_INSTALL%\lib\derby.jar</EM></P>
+      </TD>
+    </TR>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=821050></A>
+      <P class=CellBody>Derby Network Server:</P>
+      <A name=819200></A>
+      <P class=CellBody><EM class=fileName>derbynet.jar</EM></P>
+      </TD>
+      <TD class=DefaultTable><A name=819205></A>
+      <P class=CellBody><EM 
+        class=fileName>%DERBY_INSTALL%\lib\derbynet.jar</EM></P>
+      </TD>
+    </TR>
+  </TBODY>
+</TABLE>
+  <BR>
+  <TABLE cellSpacing=2 cellPadding=3 bgColor=silver border=0>
+    <TBODY>
+      <TR vAlign=top>
+        <TD class=BoxTable>
+        <H3 class=BoxHead><A name=819210></A>A note on setting the classpath for 
+        a server environment</H3>
+        <A name=819214></A>
+        <P class=CellBody>Derby provides a script to help you get started with 
+        setting the classpath in <BR>
+        <EM 
+        class=fileName>%DERBY_INSTALL%\frameworks\NetworkServer\bin</EM>. This 
+        script is called <EM class=fileName>setNetworkServerCP</EM> and comes in 
+        two flavors: one for Windows environment (this file ends with <EM 
+        class=fileName>.bat</EM>) and one for UNIX environments (this file ends 
+        with <EM class=fileName>.ksh</EM>). For users working in those environments using the Derby Network Server,
+      copying the commands in this file will help you get started setting the
+      classpath on the server process. </P>
+        </TD>
+      </TR>
+    </TBODY>
+  </TABLE>
+</BLOCKQUOTE>
+  <LI class="Normal">Run Derby's Sysinfo utility for testing the classpath for a server environment.
+  You will provide the arguments <EM 
+  class=Emphasis>server</EM> to indicate a server environment and <EM 
+  class=Emphasis>SimpleApp.class</EM> to test for the presence of the <EM 
+  class=javaObject>SimpleApp</EM> class.
+  <BR>
+  If your environment is set up correctly, the utility shows output indicating success. It looks like this:<BR>
+  <BR>
+  java org.apache.derby.tools.sysinfo -cp server SimpleApp.class<BR><br>
+FOUND IN CLASS PATH:<BR>
+<BR>
+   <BLOCKQUOTE>
+Derby Network Server library (derbynet.jar)<BR>
+<BR>
+<BR>
+  user-specified class (SimpleApp)</BLOCKQUOTE>
+<BR>
+<BR>
+  SUCCESS: All Derby related classes found in class path.<BR>
+  <LI class="Normal"><A name=816724></A>Now start the Network Server:<BR>
+  <A name=818909>java org.apache.derby.drda.NetworkServerControl start</A><BR>
+  <BLOCKQUOTE>A sucessful start produces the following output:</BLOCKQUOTE>
+<BLOCKQUOTE>
+<BLOCKQUOTE><CODE>Server is ready to accept connections on port 1527.</CODE></BLOCKQUOTE>
+</BLOCKQUOTE>
+
+</OL>
+<P <A name="derbyClient"><B>Next run the SimpleApp demo in Derby client mode:</B></P>
+<OL type=1>
+  <LI class=Normal value=1><A name=816724></A>Open a command window to run the application in client mode
+  <LI class="Normal"><A name=816724></A>If you haven't set it already on a system-wide basis, set the DERBY_INSTALL
+  environment variable for the current command window to the location of
+  the directory where you installed the Derby software 
+  <LI class="Normal"><A name=816724></A>Change directories to the %DERBY_INSTALL%<EM class=fileName>\demo\programs\simple</EM> directory.
+  <LI class="Normal"><A name=816724></A>In the command window for the client, set the CLASSPATH as follows:
+<BLOCKQUOTE>WINDOWS: set CLASSPATH=.;%DERBY_INSTALL%\lib\derbyclient.jar<BR>
+UNIX (ksh): export CLASSPATH=.:${DERBY_INSTALL}/lib/derbyclient.jar</BLOCKQUOTE>
+<BLOCKQUOTE>
+<TABLE cellSpacing=0 cellPadding=5 bgColor=#faf0e6 border=4>
+  <CAPTION class=TableTitle>Classpath for the client process when using the Derby network client</CAPTION>
+  <TBODY>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=821950></A>
+      <P class=CellBody>Derby network client:</P>
+      <A name=819200></A>
+      <P class=CellBody><EM class=fileName>derbyclient.jar</EM></P>
+      </TD>
+      <TD class=DefaultTable><A name=819305></A>
+      <P class=CellBody><EM 
+        class=fileName>%DERBY_INSTALL%\lib\derbyclient.jar</EM></P>
+      </TD>
+    </TR>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=819204></A>
+      <P class=CellBody>current directory<BR>SimpleApp.class</P>
+      </TD>
+      <TD class=DefaultTable><A name=819206></A>
+      <P class=CellBody>.\</P>
+      </TD>
+    </TR>
+  </TBODY>
+</TABLE>
+</BLOCKQUOTE>
+  <LI class="Normal">Run Derby's Sysinfo utility for testing the classpath for a client environment.
+  You will provide the arguments <EM 
+  class=Emphasis>client</EM> to indicate a client environment and <EM 
+  class=Emphasis>SimpleApp.class</EM> to test for the presence of the <EM 
+  class=javaObject>SimpleApp</EM> class. Note that the following assumes you have not downloaded the IBM
+  DB2 JDBC Universal Driver (see the next section for details) so the db2jcc.jar
+  is listed as NOT FOUND - this is not a problem.<BR>
+  If your environment is set up correctly, the utility shows output indicating success. It looks like this:<BR>
+  <BR>
+  java org.apache.derby.tools.sysinfo -cp client SimpleApp.class<BR>
+FOUND IN CLASS PATH:<BR>
+<BR><BLOCKQUOTE>
+   Derby Client libraries (derbyclient.jar)<BR>
+<BR>
+<BR>
+  user-specified class (SimpleApp)</BLOCKQUOTE>
+  <BR>
+NOT FOUND IN CLASS PATH:<BR>
+<BR><BLOCKQUOTE>
+   Derby Client libraries (db2jcc.jar)<BR>
+  (com.ibm.db2.jcc.DB2Driver not found.)</BLOCKQUOTE>
+<BR>
+  <LI class="Normal"><A name=816724></A>Now start the SimpleApp in Derby client mode:<BR>
+  <br><A name=818909>java SimpleApp derbyclient</A><BR>
+  <BR>
+  <A name=818687></A>A successful run produces the following output:
+  <P><A name=820970></A>SimpleApp starting in derbyclient mode.<BR>
+  Loaded the appropriate driver.<BR>
+  Connected to and created database derbyDB<BR>
+  Created table derbyDB<BR>
+  Inserted 1956 Webster<BR>
+  Inserted 1910 Union<BR>
+  Updated 1956 Webster to 180 Grand<BR>
+  Updated 180 Grand to 300 Lakeshore<BR>
+  Verified the rows<BR>
+  Dropped table derbyDB<BR>
+  Closed result set and statement<BR>
+  Committed transaction and closed connection<BR>
+  SimpleApp finished</P>
+</OL>
+<P><B>Running the SimpleApp demo using the IBM DB2 JDBC Universal Driver:</B></P>
+<P>In version 10.0 of Derby, the IBM DB2 JDBC Universal Driver was the only client driver
+that could communicate with the Derby Network Server. This driver is not licensed under the <a href="http://www.apache.org/licenses/">Apache License, Version 2.0</a> used by Apache Derby, but can be downloaded from the IBM developerWorks
+website (see: <A href="http://www-106.ibm.com/developerworks/db2/downloads/jcc/">IBM 
+      DB2 JDBC Universal Driver, for Apache Derby Network Server</A> for more information). Beginning with version 10.1, the Derby network client driver is bundled with the Derby distribution and this is the recommended client driver for most applications. The DB2 Universal Driver is still supported and can be utilized with the SimpleApp demo as follows (these instructions assume you have unzipped the Universal Driver into the <EM>lib</EM> directory of <EM>DERBY_INSTALL</EM>):</P>
+<OL type="1">
+  <LI class=Normal value=1><A name=JccSteps></A>Open a command window to run the application in client mode using the DB2
+  Universal Driver
+  <LI class="Normal"><A name=JccSteps></A>If you haven't set it already on a system-wide basis, set the DERBY_INSTALL
+  environment variable for the current command window to the location of
+  the directory where you installed the Derby software. It is assumed that you
+  installed the IBM DB2 JDBC Universal Driver jar in the lib subdirectory
+  at this location.
+  <LI class="Normal"><A name=JccSteps></A>Change directories to the %DERBY_INSTALL%<EM class=fileName>\demo\programs\simple</EM> directory.
+  <li class="Normal"><a href="#Server">Set the Network Server classpath</a> as you would if using the Derby network client.
+  <LI class="Normal"><A name=JccSteps></A>In the command window for the client, set the classpath as follows:
+<BLOCKQUOTE>WINDOWS: set CLASSPATH=.;%DERBY_INSTALL%\lib\db2jcc.jar;%DERBY_INSTALL%\lib\db2jcc_license_c.jar<BR>
+UNIX (ksh): export CLASSPATH=.:${DERBY_INSTALL}/lib/db2jcc.jar:${DERBY_INSTALL}/lib/db2jcc_license_c.jar</BLOCKQUOTE>
+<BLOCKQUOTE>
+<TABLE cellSpacing=0 cellPadding=5 bgColor=#faf0e6 border=4>
+  <CAPTION class=TableTitle>Classpath for the client process when using the IBM DB2 JCC Client Driver</CAPTION>
+  <TBODY>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=821950></A>
+      <P class=CellBody>IBM DB2 JCC Client Driver jar files:</P>
+      <A 
+        name=819200></A>
+      <P class=CellBody><EM class=fileName>db2jcc.jar</EM> and <EM 
+        class=fileName>db2jcc_license_c.jar</EM></P>
+      </TD>
+      <TD class=DefaultTable><A name=819305></A>
+      <P class=CellBody><EM 
+        class=fileName>%DERBY_INSTALL%\lib\db2jcc_license_c.jar</EM><BR>
+      <EM 
+        class=fileName>%DERBY_INSTALL%\lib\db2jcc.jar</EM></P>
+      </TD>
+    </TR>
+    <TR vAlign=top>
+      <TD class=DefaultTable><A name=819204></A>
+      <P class=CellBody>current directory<BR>
+      SimpleApp.class</P>
+      </TD>
+      <TD class=DefaultTable><A name=819206></A>
+      <P class=CellBody>.\</P>
+      </TD>
+    </TR>
+  </TBODY>
+</TABLE>
+</BLOCKQUOTE>
+  <LI class="Normal"><A name=JccSteps></A>Now start the SimpleApp demo in Derby client mode:<BR><br>
+  <A name=818909>java SimpleApp jccjdbcclient</A>
+ </OL>
+<BLOCKQUOTE><A name=818687></A></BLOCKQUOTE>
+<BLOCKQUOTE>A successful run produces the following output:<BR>
+</BLOCKQUOTE>
+<BLOCKQUOTE>SimpleApp starting in jccjdbc mode.<BR>
+Loaded the appropriate driver.<BR>
+Connected to and created database derbyDB<BR>
+Created table derbyDB<BR>
+Inserted 1956 Webster<BR>
+Inserted 1910 Union<BR>
+Updated 1956 Webster to 180 Grand<BR>
+Updated 180 Grand to 300 Lakeshore<BR>
+Verified the rows<BR>
+Dropped table derbyDB<BR>
+Closed result set and statement<BR>
+Committed transaction and closed connection<BR>
+SimpleApp finished</BLOCKQUOTE>
+<BR>
+<TABLE cellSpacing=2 cellPadding=3 bgColor=silver border=0>
+    <TBODY>
+      <TR vAlign=top>
+        <TD class=BoxTable>
+        <H3 class=BoxHead><A name=819210></A>A note on setting the classpath for a client environment (JCC)</H3>
+        <A name=819214></A>
+        <P class=CellBody>Derby provides a script to help you get started with setting the IBM DB2
+      JDBC Universal Driver client classpath: <BR>
+        <EM 
+        class=fileName>%DERBY_INSTALL%\frameworks\NetworkServer\bin</EM>. This 
+        script is called <EM class=fileName>setNetworkClientCP</EM> and comes in 
+        two flavors: one for Windows environment (this file ends with <EM 
+        class=fileName>.bat</EM>) and one for UNIX environments (this file ends 
+        with <EM class=fileName>.ksh</EM>). For users working in those environments using the IBM DB2 JCC Client
+      Driver Client, copying the commands in this file will help you get started
+      setting the classpath on the client process. Note to use these scripts
+      copy the jar files into the <EM 
+        class=fileName>%DERBY_INSTALL%\lib </EM>directory.</P>
+        </TD>
+      </TR>
+    </TBODY>
+  </TABLE>
+  <P class=NavBarVersion>Apache Derby Version 10.1</P>
 
 </body>
 </html>

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/diag/ErrorMessages.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/diag/ErrorMessages.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/diag/ErrorMessages.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/diag/ErrorMessages.java Fri Jul  1 10:28:49 2005
@@ -47,12 +47,12 @@
 
 
 /** 
- * ErrorMessage is a VTI that shows all the SQLStates, locale-sensitive error
+ * ErrorMessage shows all the SQLStates, locale-sensitive error
  * messages, and exception severities for a database.
  * 
- * <p>To use it, query it as an external virtual table:</p>
- * <PRE> SELECT* FROM NEW ErrorMessages() AS EQ; </PRE>
- * <P>The ErrorMessages VTI has the following columns:
+ * <p>To use it, query it as follows:</p>
+ * <PRE> SELECT* FROM NEW org.apache.derby.diag.ErrorMessages() AS EQ; </PRE>
+ * <P>The following columns will be returned:
  * <UL><LI>SQL_STATE--VARCHAR(5) - nullable.  The SQLState of the SQLException.<br>
  * (The code returned by getSQLState() in SQLException.)</LI>
  * <LI>MESSAGE--VARCHAR(32672) - nullable.  The error message<br>

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java Fri Jul  1 10:28:49 2005
@@ -33,12 +33,21 @@
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 
+import java.lang.reflect.*;
+
+import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derby.iapi.error.PublicAPI;
+import org.apache.derby.iapi.error.StandardException;
+
 /**
  * This is a rudimentary connection that delegates
  * EVERYTHING to Connection.
  */
 public class BrokeredConnection implements Connection
 {
+	
+	// default for Derby
+	protected int stateHoldability = JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
 
 	protected final BrokeredConnectionControl control;
 	private boolean isClosed;
@@ -383,6 +392,15 @@
 		stateIsolationLevel = conn.getTransactionIsolation();
 		stateReadOnly = conn.isReadOnly();
 		stateAutoCommit = conn.getAutoCommit();
+		// jdk13 does not have Connection.getHoldability method and hence using
+		// reflection to cover both jdk13 and higher jdks
+		try {
+			Method sh = conn.getClass().getMethod("getHoldability", null);
+			stateHoldability = ((Integer)sh.invoke(conn, null)).intValue();
+		} catch( Exception e)
+		{
+			throw PublicAPI.wrapStandardException( StandardException.plainWrapException( e));
+		}       
 	}
 
 	/**
@@ -396,6 +414,8 @@
 		
 	*/
 	public void setState(boolean complete) throws SQLException {
+		Class[] CONN_PARAM = { Integer.TYPE };
+		Object[] CONN_ARG = { new Integer(stateHoldability)};
 
 		Connection conn = getRealConnection();
 
@@ -403,6 +423,18 @@
 			conn.setTransactionIsolation(stateIsolationLevel);
 			conn.setReadOnly(stateReadOnly);
 			conn.setAutoCommit(stateAutoCommit);
+			// make the underlying connection pick my holdability state
+			// since holdability is a state of the connection handle
+			// not the underlying transaction.
+			// jdk13 does not have Connection.setHoldability method and hence using
+			// reflection to cover both jdk13 and higher jdks
+			try {
+				Method sh = conn.getClass().getMethod("setHoldability", CONN_PARAM);
+				sh.invoke(conn, CONN_ARG);
+			} catch( Exception e)
+			{
+				throw PublicAPI.wrapStandardException( StandardException.plainWrapException( e));
+			}
 		}
 	}
 

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java Fri Jul  1 10:28:49 2005
@@ -32,9 +32,6 @@
  */
 public class BrokeredConnection30 extends BrokeredConnection
 {
-	
-	// default for Cloudscape
-	private int stateHoldability = java.sql.ResultSet.HOLD_CURSORS_OVER_COMMIT;
 
 	public	BrokeredConnection30(BrokeredConnectionControl control)
 	{
@@ -215,19 +212,6 @@
 			notifyException(se);
 			throw se;
 		}
-	}
-	public void syncState() throws SQLException {
-		super.syncState();
-		// make the underlying connection pick my holdability state
-		// since holdability is a state of the connection handle
-		// not the underlying transaction.
-		getRealConnection().setHoldability(stateHoldability);
-	}
-
-	public void setState(boolean complete) throws SQLException {
-		super.setState(complete);
-		if (complete) 
-			getRealConnection().setHoldability(stateHoldability);
 	}
 
 	public BrokeredPreparedStatement newBrokeredStatement(BrokeredStatementControl statementControl, String sql, Object generatedKeys) throws SQLException {

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ColumnInfo.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ColumnInfo.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ColumnInfo.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ColumnInfo.java Fri Jul  1 10:28:49 2005
@@ -80,13 +80,14 @@
 		columnTypes = new ArrayList(1);
 		noOfColumns = 0;
 		this.conn = conn;
-		this.schemaName = (sName !=null ? sName.toUpperCase(java.util.Locale.ENGLISH):sName);
-		this.tableName =  (tName !=null ? tName.toUpperCase(java.util.Locale.ENGLISH):tName);
+
+		this.schemaName = sName;
+		this.tableName =  tName;
 
 		if(insertColumnList!=null)
 		{
 			//break the comma seperated column list and initialze column info
-			//eg: c2 , c1 , c3
+			//eg: C2 , C1 , C3
 			StringTokenizer st = new StringTokenizer(insertColumnList , ",");
 			while (st.hasMoreTokens()) 
 			{
@@ -152,7 +153,7 @@
 		ResultSet rs = dmd.getColumns(null, 
 									  schemaName,
 									  tableName,
-									  (columnPattern !=null ? columnPattern.toUpperCase(java.util.Locale.ENGLISH):columnPattern));
+									  columnPattern);
 		boolean foundTheColumn=false;
 		while (rs.next())
 		{
@@ -306,8 +307,9 @@
 			return sb.toString();
 	}
 
-	/* returns comma seperated column Names for insert statement
-	 * eg: c1, c2 , c3 , c4 
+	/* returns comma seperated column Names delimited by quotes for the insert 
+     * statement
+	 * eg: "C1", "C2" , "C3" , "C4" 
 	 */
 	public String getInsertColumnNames()
 	{
@@ -319,7 +321,11 @@
 				sb.append(", ");
 			else
 				first = false;
+			// column names can be SQL reserved words, so it 
+			// is necessary delimit them using quotes for insert to work correctly. 
+			sb.append("\"");
 			sb.append(insertColumnNames.get(index));
+			sb.append("\"");
 		}
 	
 		//there is no column info available
@@ -354,9 +360,6 @@
 	}
 
 }
-
-
-
 
 
 

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportResultSetForObject.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportResultSetForObject.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportResultSetForObject.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/ExportResultSetForObject.java Fri Jul  1 10:28:49 2005
@@ -24,93 +24,104 @@
 import java.sql.Statement;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
 
 //uses the passed connection and table/view name to make the resultset on
 //that entity. If the entity to be exported has non-sql types in it, an
 //exception will be thrown
 class ExportResultSetForObject {
 
-  private Connection con;
-  private String entityName;
-  private String selectStatement;
-  private ResultSet rs;
-  private int columnCount;
-  private String columnNames[];
-  private String columnTypes[];
-  private int columnLengths[];
-
-	private Statement expStmt = null; 
-
-	//uses the passed connection and table/view name to make the resultset on
-	//that entity.
+    private Connection con;
+    private String selectQuery;
+    private ResultSet rs;
+    private int columnCount;
+    private String columnNames[];
+    private String columnTypes[];
+    private int columnLengths[];
+
+    private Statement expStmt = null; 
+    private String schemaName;
+    private String tableName;
+
+	/* set up the connection and table/view name or the select query
+	 * to make the result set, whose data is exported. 
+	 **/
 	public ExportResultSetForObject(Connection con, String schemaName, 
-									String tableName, String selectStatement 
+									String tableName, String selectQuery 
 									) 
 	{
 		this.con = con;
-		if( selectStatement == null)
-			this.entityName = (schemaName == null ? tableName : schemaName + "." + tableName); 
-		this.selectStatement = selectStatement;
+		if( selectQuery == null)
+		{
+			this.schemaName = schemaName;
+			this.tableName = tableName;
+			
+			// delimit schema Name and table Name using quotes because
+			// they can be case-sensitive names or SQL reserved words. Export
+			// procedures are expected to be called with case-senisitive names. 
+			// undelimited names are passed in upper case, because that is
+			// the form database stores them. 
+			
+			this.selectQuery = "select * from " + 
+				(schemaName == null ? "\"" + tableName + "\"" : 
+				 "\"" + schemaName + "\"" + "." + "\"" + tableName + "\""); 
+		}
+        else
+		{
+			this.selectQuery = selectQuery;
+		}
 	}
 
 
-  public ResultSet getResultSet() throws Exception {
-    rs = null;
-    String queryString = getQuery();
-    //execute select on passed enitity and keep it's meta data info ready
-    Statement expStmt = con.createStatement();
-    rs = expStmt.executeQuery(queryString);
-    getMetaDataInfo();
-    return rs;
-  }
-
-  public String getQuery(){
-	  if(selectStatement != null)
-		  return selectStatement;
-	  else
-	  {
-		  selectStatement = "select * from " + entityName;
-		  return selectStatement;
-	  }
-  }
-
-  public int getColumnCount() {
-    return columnCount;
-  }
-
-  public String[] getColumnDefinition() {
-    return columnNames;
-  }
-
-  public String[] getColumnTypes() {
-    return columnTypes;
-  }
-
-  public int[] getColumnLengths() {
-    return columnLengths;
-  }
-
-  //if the entity to be exported has non-sql types in it, an exception will be thrown
-  private void getMetaDataInfo() throws Exception {
-    ResultSetMetaData metaData = rs.getMetaData();
-    columnCount = metaData.getColumnCount();
-	  int numColumns = columnCount;
-    columnNames = new String[numColumns];
-	columnTypes = new String[numColumns];
-    columnLengths = new int[numColumns];
-    for (int i=0; i<numColumns; i++) {
-	  int jdbcTypeId = metaData.getColumnType(i+1);
-	  columnNames[i] = metaData.getColumnName(i+1);
-	  columnTypes[i] = metaData.getColumnTypeName(i+1);
-	  if(!ColumnInfo.importExportSupportedType(jdbcTypeId))
-	  {
-		  throw LoadError.nonSupportedTypeColumn(columnNames[i],
-												 columnTypes[i]); 
+    public ResultSet getResultSet() throws SQLException {
+        rs = null;
+        //execute the select query and keep it's meta data info ready
+        expStmt = con.createStatement();
+        rs = expStmt.executeQuery(selectQuery);
+        getMetaDataInfo();
+        return rs;
       }
-      	 
-      columnLengths[i] = metaData.getColumnDisplaySize(i+1);
+
+
+    public int getColumnCount() {
+        return columnCount;
+    }
+
+    public String[] getColumnDefinition() {
+        return columnNames;
+    }
+
+    public String[] getColumnTypes() {
+        return columnTypes;
+    }
+
+    public int[] getColumnLengths() {
+        return columnLengths;
+    }
+
+    //if the entity to be exported has non-sql types in it, an exception will be thrown
+    private void getMetaDataInfo() throws SQLException {
+        ResultSetMetaData metaData = rs.getMetaData();
+        columnCount                = metaData.getColumnCount();
+        int numColumns             = columnCount;
+        columnNames                = new String[numColumns];
+        columnTypes                = new String[numColumns];
+        columnLengths              = new int[numColumns];
+
+        for (int i=0; i<numColumns; i++) {
+            int jdbcTypeId = metaData.getColumnType(i+1);
+            columnNames[i] = metaData.getColumnName(i+1);
+            columnTypes[i] = metaData.getColumnTypeName(i+1);
+            if(!ColumnInfo.importExportSupportedType(jdbcTypeId))
+            {
+                throw LoadError.nonSupportedTypeColumn(
+                            columnNames[i], columnTypes[i]); 
+            }
+         
+            columnLengths[i] = metaData.getColumnDisplaySize(i+1);
+        }
     }
-  }
 
 	public void  close() throws Exception
 	{
@@ -118,8 +129,3 @@
 			expStmt.close();
 	}
 }
-
-
-
-
-

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/Import.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/Import.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/Import.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/load/Import.java Fri Jul  1 10:28:49 2005
@@ -160,9 +160,9 @@
 		if (connection == null)
 			throw LoadError.connectionNull();
 		
-		String entityName = (schemaName == null ? tableName : schemaName + "." + tableName); 
+	
 		
-		if (entityName == null)
+		if (tableName == null)
 			throw LoadError.entityNameMissing();
 		
 
@@ -197,6 +197,18 @@
 
 		String importvti = sb.toString();
 
+		// delimit the table and schema names with quotes.
+		// because they might have been  created as quoted
+		// identifiers(for example when reserved words are used, names are quoted)
+		
+		// Import procedures are to be called with case-senisitive names. 
+		// Incase of delimited table names, they need to be passed as defined
+		// and when they are not delimited, they need to be passed in upper
+		// case, because all undelimited names are stored in the upper case 
+		// in the database. 
+
+		String entityName = (schemaName == null ? "\""+ tableName + "\"" : 
+							 "\"" + schemaName + "\"" + "." + "\"" + tableName + "\""); 
 
 		String insertModeValue;
 		if(replace > 0)

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java Fri Jul  1 10:28:49 2005
@@ -251,6 +251,11 @@
 		if (aliasType != AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR)
 			return this;
 
+		// Don't allow creating synonyms in SESSION schema. Causes confusion if
+		// a temporary table is created later with same name.
+		if (isSessionSchema(getSchemaDescriptor().getSchemaName()))
+			throw StandardException.newException(SQLState.LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES);
+
 		String targetSchema = ((SynonymAliasInfo)aliasInfo).getSynonymSchema();
 		String targetTable = ((SynonymAliasInfo)aliasInfo).getSynonymTable();
 		if (this.getObjectName().equals(targetSchema, targetTable))

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java Fri Jul  1 10:28:49 2005
@@ -766,25 +766,22 @@
 	}
 
 	/**
-	 * This method will get called if the statement is referencing tables in SESSION schema.
-	 * We do not want to cache such statements because multiple connections can have
-	 * different definition of the same table name and hence compiled plan for one connection
-	 * may not make sense for some other connection. Because of this, remove the statement from the cache
-	 *
-	 * @exception StandardException thrown if lookup goes wrong.
-	 */
+	*  This method will remove a statement from the  statement cache.
+	*  It will be called,  for example, if there is an exception preparing
+	*  the statement.
+	*
+	*  @param statement Statement to remove
+	*  @exception StandardException thrown if lookup goes wrong.
+	*/	
 	public void removeStatement(Statement statement)
 		throws StandardException {
 
 		if (statementCache == null)
 			return;
-
-		synchronized (statementCache) {
-
+ 
 			Cacheable cachedItem = statementCache.findCached(statement);
 			if (cachedItem != null)
 				statementCache.remove(cachedItem);
-		}
 	}
 
 	/**

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java Fri Jul  1 10:28:49 2005
@@ -232,10 +232,11 @@
 			}
 		}
 
-		// 0 is an invalid parameter
+                // Absolute 0 is defined to be before first!
 		if (row == 0)
 		{
-			throw StandardException.newException(SQLState.LANG_ZERO_INVALID_FOR_R_S_ABSOLUTE);
+                    setBeforeFirstRow();
+                    return null;
 		}
 
 		if (row > 0)
@@ -330,16 +331,15 @@
 			}
 		}
 
-		/* Throw exception if before first or after last */
-		if (beforeFirst || afterLast)
-		{
-			throw StandardException.newException(SQLState.LANG_NO_CURRENT_ROW_FOR_RELATIVE);
-		}
-
 		// Return the current row for 0
 		if (row == 0)
 		{
+                    if ((beforeFirst || afterLast) ||
+                        (!beforeFirst && !afterLast)) {
+                        return null;
+                    } else {
 			return getRowFromHashTable(currentPosition);
+                    }
 		}
 		else if (row > 0)
 		{

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocExtent.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocExtent.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocExtent.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocExtent.java Fri Jul  1 10:28:49 2005
@@ -587,6 +587,43 @@
         return;
     }
 
+    /**
+     * Undo the compress space operation.
+     * <p>
+     * Undo of this operation doesn't really "undo" the operation, it just
+     * makes sure the data structures are ok after the undo.  We are 
+     * guaranteed at the point of the transaction doing the 
+     * Undo of the compress space operation fixes up the bit maps to
+     * only point at pages within the new_highest_page range.
+     * <p>
+     * Prior to logging the compress space operation all pages greater 
+     * than 
+     * There are only 2 possibilities at this point:
+     * 1) the truncate of pages greater than new_highest_page happened before
+     *    the abort took place.  W
+     * 2) 
+     *
+	 * @return The identifier to be used to open the conglomerate later.
+     *
+     * @param param1 param1 does this.
+     * @param param2 param2 does this.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+    protected void undoCompressPages(
+    int        new_highest_page,
+    int        num_pages_truncated)
+    {
+        if (new_highest_page >= 0)
+        {
+            freePages.shrink(new_highest_page + 1);
+            unFilledPages.shrink(new_highest_page + 1);
+            preAllocLength = extentLength = (new_highest_page + 1);
+        }
+
+        return;
+    }
+
 	protected long getExtentEnd()
 	{
 		return extentEnd;

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java Fri Jul  1 10:28:49 2005
@@ -916,6 +916,21 @@
         extent.compressPages(new_highest_page, num_pages_truncated);
 	}
 
+    /**
+     * Handle undo of compress space operation.
+     **/
+	protected void undoCompressSpace(
+    LogInstant  instant,
+    int         new_highest_page,
+    int         num_pages_truncated)
+		throws StandardException
+    {
+		logAction(instant);
+
+        extent.undoCompressPages(new_highest_page, num_pages_truncated);
+
+    }
+
 	public String toString()
 	{
 		if (SanityManager.DEBUG)

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java Fri Jul  1 10:28:49 2005
@@ -221,7 +221,7 @@
 		}
 		finally
 		{
-            ntt.commitNoSync(Transaction.RELEASE_LOCKS);
+            ntt.commit();
 
 			ntt.close();
 		}

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/CompressSpacePageOperation.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/CompressSpacePageOperation.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/CompressSpacePageOperation.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/CompressSpacePageOperation.java Fri Jul  1 10:28:49 2005
@@ -182,7 +182,7 @@
 				"undo Page is not an allocPage");
 		}
 
-		((AllocPage)undoPage).compressSpace(
+		((AllocPage)undoPage).undoCompressSpace(
              CLRInstant, newHighestPage, num_pages_truncated);
 	}
 

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java Fri Jul  1 10:28:49 2005
@@ -1351,6 +1351,12 @@
 			return;
         }
 
+        // make sure we don't execute redo recovery on any page
+        // which is getting truncated.  At this point we have an exclusive
+        // table lock on the table, so after checkpoint no page change
+        // can happen between checkpoint log record and compress of space.
+        dataFactory.getRawStoreFactory().checkpoint();
+
 		try
 		{
             synchronized(allocCache)
@@ -1388,6 +1394,7 @@
                 // reset, as pages may not exist after compress
                 lastUnfilledPage    = ContainerHandle.INVALID_PAGE_NUMBER;
                 lastAllocatedPage   = ContainerHandle.INVALID_PAGE_NUMBER;
+
 
                 alloc_page.compress(ntt, this);
             }

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/PhysicalUndoOperation.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/PhysicalUndoOperation.java?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/PhysicalUndoOperation.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/PhysicalUndoOperation.java Fri Jul  1 10:28:49 2005
@@ -146,7 +146,19 @@
 		undoOp.undoMe(xact, this.page, instant, in);
 
 		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT(oldversion < this.page.getPageVersion());
+
+            if (oldversion >= this.page.getPageVersion())
+            {
+                SanityManager.THROWASSERT(
+                    "oldversion = " + oldversion +
+                    ";page version = "  + this.page.getPageVersion() +
+                    "page = " + page + 
+                    "; my class name is " + getClass().getName() +
+                    " undoOp is " + undoOp.getClass().getName() );
+            }
+			SanityManager.ASSERT(
+                oldversion < this.page.getPageVersion());
+
 			if (instant != null &&
 				! instant.equals(this.page.getLastLogInstant()))
 				SanityManager.THROWASSERT(

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/loc/messages_en.properties?rev=208776&r1=208775&r2=208776&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/loc/messages_en.properties Fri Jul  1 10:28:49 2005
@@ -1095,7 +1095,7 @@
 XJ077.S=Got an exception when trying to read the first byte/character of the BLOB/CLOB pattern using getBytes/getSubString.
 XJ082.U=BLOB/CLOB values are not allowed as method parameters or receiver.
 XJ083.U=''{0}'' not allowed because the ResultSet is not an updatable ResultSet. 
-XJ084.U=Column does not correspond to a column in the base table. Can't issue {0} on this column.
+XJ084.U=Column does not correspond to a column in the base table. Cannot issue ''{0}'' on this column.
 
 0A000.S=Feature not implemented: {0}.