You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2013/12/04 20:46:36 UTC

[jira] [Updated] (CAY-1890) Remove Cayenne-level buffering when retrieving LOBs

     [ https://issues.apache.org/jira/browse/CAY-1890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1890:
---------------------------------

    Priority: Minor  (was: Major)

> 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
>            Priority: Minor
>             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)