You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Eugene Matyushkin (JIRA)" <ji...@apache.org> on 2009/05/28 14:22:45 UTC
[jira] Created: (CAY-1231) Problem with CLOB field under Oracle
Problem with CLOB field under Oracle
------------------------------------
Key: CAY-1231
URL: https://issues.apache.org/jira/browse/CAY-1231
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 2.0 branch
Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
Reporter: Eugene Matyushkin
Priority: Critical
1. Creating table:
CREATE TABLE CRM_PDOCTYPECAT (
PDOCTYPECATID NUMERIC(19,0) NOT NULL,
CATNAME VARCHAR(255) NOT NULL,
CATDESCRIPTION CLOB NULL
);
2. Creating named query
INSERT INTO CRM_PDOCTYPECAT(
PDOCTYPECATID,
CATNAME,
CATDESCRIPTION
) VALUES (
#bind($PDOCTYPECATID 'NUMERIC'),
#bind($CATNAME 'VARCHAR'),
#bind($CATDESCRIPTION 'CLOB')
)
3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
4. Executing query
Result:
2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
java.sql.SQLException: setString can process only strings less then 32766 symbols in length
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik reassigned CAY-1231:
------------------------------------
Assignee: Andrus Adamchik
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Fix For: 2.0.5
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik closed CAY-1231.
--------------------------------
Resolution: Not A Problem
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Attachments: CAY-1231_check.patch
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713981#action_12713981 ]
Andrus Adamchik commented on CAY-1231:
--------------------------------------
thanks, we'll try to reproduce it. In the meantime, if you have a chance to try it with latest 3.0 release, I will be interested to know how that worked.
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Priority: Critical
> Fix For: 2.0.5
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Eugene Matyushkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715003#action_12715003 ]
Eugene Matyushkin commented on CAY-1231:
----------------------------------------
We've checked this on 3.0M6. The same result..
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Fix For: 2.0.5
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715048#action_12715048 ]
Andrus Adamchik commented on CAY-1231:
--------------------------------------
Eugene,
our testing shows this is related to the Oracle driver version. We used Oracle 9 in both tests:
1. We get an error on 'setString' when the string is longer than 32765.
Manifest-Version: 1.0
Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
Specification-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
Specification-Vendor: "Oracle Corporation" .
Implementation-Title: "ojdbc14_g.jar"
Implementation-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
Implementation-Vendor: "Oracle Corporation"
Implementation-Time: "Thu Apr 25 23:48:25 2002"
2.
Specification-Version: Oracle JDBC Driver version - "11.1.0.6.0-Produc
tion"
Implementation-Version: Oracle JDBC Driver version - "11.1.0.6.0-Produ
ction"
Here is some information from Oracle on the topic.
We get no error on setString even with multi-megabyte Clobs.
Also we tried using 'setClob' - this doesn't work with an arbitrary implementation of Clob (the one we use in Cayenne is called MemoryClob, Oracle expects its own I guess). So please try upgrading the driver.
Also here is some Oracle wisdom on the use of Clobs:
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/clob10g/handlingclobsinoraclejdbc10g.html
Specifically check out this paragraph, that mentions a workaround for Oracle 10 drivers:
"The enhanced standard APIs for manipulating CLOBs are the setString() and getString() of the PreparedStatement and ResultSet objects respectively. By default, the method preparedStatement.setString() will allow processing of the strings up to 32765 bytes. In order to insert data greater than 32765 bytes, a newly introduced Connection property - SetBigStringTryClob can be set. This forces the preparedStatement.setString() to use another newly introduced method, OraclePreparedStatement.setStringForClob() instead. This is actually done internally, transparent to the user."
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Fix For: 2.0.5
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Evgeny Ryabitskiy resolved CAY-1231.
------------------------------------
Resolution: Fixed
Closing. Working properly with new driver.
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Fix For: 2.0.5
>
> Attachments: CAY-1231_check.patch
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik updated CAY-1231:
---------------------------------
Fix Version/s: (was: 2.0.5)
so changing some jira fields here... I understand that nothing has to be changed in Cayenne, and the fix is to upgrade Oracle driver.
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Attachments: CAY-1231_check.patch
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik reopened CAY-1231:
----------------------------------
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Attachments: CAY-1231_check.patch
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Eugene Matyushkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eugene Matyushkin updated CAY-1231:
-----------------------------------
Fix Version/s: 2.0.5
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Priority: Critical
> Fix For: 2.0.5
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAY-1231) Problem with CLOB field under Oracle
Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Evgeny Ryabitskiy updated CAY-1231:
-----------------------------------
Attachment: CAY-1231_check.patch
Was tested with latest Oracle Driver: version: 11.2.0.1.0 (ojdbc5_g-11.2.0.1.0.jar)
Working properly.
Even for 64 000 000 chars string.
> Problem with CLOB field under Oracle
> ------------------------------------
>
> Key: CAY-1231
> URL: https://issues.apache.org/jira/browse/CAY-1231
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 2.0 branch
> Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5
> Reporter: Eugene Matyushkin
> Assignee: Andrus Adamchik
> Priority: Critical
> Fix For: 2.0.5
>
> Attachments: CAY-1231_check.patch
>
>
> 1. Creating table:
> CREATE TABLE CRM_PDOCTYPECAT (
> PDOCTYPECATID NUMERIC(19,0) NOT NULL,
> CATNAME VARCHAR(255) NOT NULL,
> CATDESCRIPTION CLOB NULL
> );
> 2. Creating named query
> INSERT INTO CRM_PDOCTYPECAT(
> PDOCTYPECATID,
> CATNAME,
> CATDESCRIPTION
> ) VALUES (
> #bind($PDOCTYPECATID 'NUMERIC'),
> #bind($CATNAME 'VARCHAR'),
> #bind($CATDESCRIPTION 'CLOB')
> )
> 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
> 4. Executing query
> Result:
> 2009-05-28 13:32:03,053 [main] INFO org.apache.cayenne.access.QueryLogger - *** error.
> java.sql.SQLException: setString can process only strings less then 32766 symbols in length
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
> at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
> I guess, setClob should be used instead of setString when working with CLOBs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.