db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r737000 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java
Date Fri, 23 Jan 2009 11:02:43 GMT
Author: kristwaa
Date: Fri Jan 23 03:02:43 2009
New Revision: 737000

URL: http://svn.apache.org/viewvc?rev=737000&view=rev
Log:
DERBY-4023: Improve length caching in TemporaryClob.
Keep track of the length where we already know it.
Patch file: derby-4023-1a-cache_length_simple.diff


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java?rev=737000&r1=736999&r2=737000&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TemporaryClob.java Fri Jan
23 03:02:43 2009
@@ -185,6 +185,7 @@
         }
         this.conChild = conChild;
         bytes = new LOBStreamControl(conChild.getEmbedConnection(), getByteFromString (data));
+        this.cachedCharLength = data.length();
     }
     /**
      * Finds the corresponding byte position for the given UTF-8 character
@@ -495,6 +496,8 @@
      *
      * @param clob the Clob to copy from
      * @param charLength number of chars to copy
+     * @throws EOFException if the length of the stream is shorter than the
+     *      specified length
      * @throws IOException if accessing I/O resources fail (both read and write)
      * @throws SQLException if accessing underlying resources fail
      */
@@ -507,6 +510,7 @@
             this.bytes.copyData(
                     new BufferedInputStream(clob.getRawByteStream()),
                     byteLength);
+            this.cachedCharLength = charLength;
         } catch (StandardException se) {
             throw Util.generateCsSQLException(se);
         }



Mime
View raw message