cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-1890) Remove Cayenne-level buffering when retrieving LOBs
Date Wed, 04 Dec 2013 19:46:36 GMT
Andrus Adamchik created CAY-1890:
------------------------------------

             Summary: Remove Cayenne-level buffering when retrieving LOBs
                 Key: CAY-1890
                 URL: https://issues.apache.org/jira/browse/CAY-1890
             Project: Cayenne
          Issue Type: Improvement
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 3.2.M2


Something like a patch below marginally improves CLOB read speed on Oracle, letting the driver
handle buffering. I don't have data for other DBs , but I would imagine it should work at
least as well.

+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/types/CharType.java
@@ -19,7 +19,6 @@
 
 package org.apache.cayenne.access.types;
 
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringWriter;
@@ -153,13 +152,7 @@ public class CharType implements ExtendedType {
             return "";
         }
 
-        int bufSize = (size < BUF_SIZE) ? size : BUF_SIZE;
-
-        Reader in = clob.getCharacterStream();
-        return (in != null) ? readValueStream(
-                new BufferedReader(in, bufSize),
-                size,
-                bufSize) : null;
+        return clob.getSubString(1, size);
     }
 
     protected String readCharStream(ResultSet rs, int index) throws IOException,




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message