cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Matyushkin (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAY-1231) Problem with CLOB field under Oracle
Date Thu, 28 May 2009 12:22:45 GMT
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.


Mime
View raw message