Re: Errors trying to insert values on Oracle LONG data type with Cayenne

From: Giulio Cesare Solaroli (giulio.cesar..mail.com)
Date: Wed Jan 26 2005 - 10:06:17 EST

  • Next message: Andrus Adamchik: "Re: Errors trying to insert values on Oracle LONG data type with Cayenne"

    Hi Andrus,

    we have tried to use both the 9.0.2 and 8.1.7 (release 2) JDBC
    drivers, but with the same outcome. With both drivers, we have been
    able to write to LONG fields using bare bones jdbc calls.

    The error we are seeing is this:
    192.168.1.6: INFO 2005-01-26 12:57:32,015 *** error.
    java.sql.SQLException: Data size bigger than max size for this type: 5633
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:147)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2460)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1190)
    at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1610)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2856)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:3107)
    at org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(AbstractType.java:78)
    at org.objectstyle.cayenne.access.types.CharType.setJdbcObject(CharType.java:202)
    at org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:544)
    at org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(BatchQueryBuilder.java:143)
    at org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsIndividualQueries(DataNode.java:591)
    at org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:495)
    at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:353)
    at org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:192)
    at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1266)
    at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1236)
    at com.extrapola.scooter.fetcher.Fetcher.run(Fetcher.java:250)
    at com.extrapola.scooter.channel.Channel.fetchItem(Channel.java:466)
    at com.extrapola.scooter.channel.Channel.computeItems(Channel.java:532)
    at com.extrapola.scooter.coordinator.Scooter.run(Scooter.java:261)
    at com.extrapola.scooter.coordinator.Scooter.main(Scooter.java:35)
    ERROR 2005-01-26 12:57:32,106 Error while Fetcher running
    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1RC2 October 24
    2004] Commit Exception
    at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1275)
    at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1236)
    at com.extrapola.scooter.fetcher.Fetcher.run(Fetcher.java:250)
    at com.extrapola.scooter.channel.Channel.fetchItem(Channel.java:466)
    at com.extrapola.scooter.channel.Channel.computeItems(Channel.java:532)
    at com.extrapola.scooter.coordinator.Scooter.run(Scooter.java:261)
    at com.extrapola.scooter.coordinator.Scooter.main(Scooter.java:35)
    Caused by: java.sql.SQLException: Data size bigger than max size for
    this type: 5633
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:147)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2460)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1190)
    at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1610)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2856)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:3107)
    at org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(AbstractType.java:78)
    at org.objectstyle.cayenne.access.types.CharType.setJdbcObject(CharType.java:202)
    at org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:544)
    at org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(BatchQueryBuilder.java:143)
    at org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsIndividualQueries(DataNode.java:591)
    at org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:495)
    at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:353)
    at org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:192)
    at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1266)
    ... 6 more

    This is the query reported into the logs:
    INSERT INTO RAWNWSCLNBDY (BODY, ID) VALUES (?, ?)

    Does this highlights any basic flaw in our code/model?

    Thanks for you attention,

    Giulio Cesare

    On Wed, 26 Jan 2005 09:18:22 -0500 (EST), Andrus Adamchik
    <andru..bjectstyle.org> wrote:
    > Hi,
    >
    > Cayenne should be able to handle that as long as JDBC does. What Oracle
    > and driver version are you using with Cayenne? What error are you getting?
    >
    > Andrus
    >
    > > Hi all,
    > >
    > > we are trying to integrate Cayenne in one of our java applications, but
    > > we are having a problem trying to insert some objects/records into a
    > > table with a LONG field.
    > >
    > > I know LONG fields have been deprecated since long ago, but we are still
    > > stuck with them as many or our applications are still developed using
    > > WebObjects 4.5.1 (using Objective-C) and its Oracle Adaptor
    > > links against a very old version of the OCI (around 7.3) that could
    > > handle only LONG fields; no LOBs available thou.
    > >
    > > Should Cayenne be able to handle LONG fields (and the problem is
    > > caused by some mistake on our code), or is it able to handle only LOBs
    > > fields?
    > >
    > > The definition of the entity in the *.map.xml file looks like this:
    > > <db-entity name="RAWNWSBDY">
    > > <db-attribute name="BODY" type="LONGVARCHAR"/>
    > > <db-attribute name="ID" type="INTEGER" isPrimaryKey="true"
    > > isMandatory="true"/>
    > > </db-entity>
    > > <obj-entity name="RawNewsBody"
    > > className="com.extrapola.scooter.dataModel.RawNewsBody"
    > > dbEntityName="RAWNWSBDY">
    > > <obj-attribute name="body" type="java.lang.String"
    > > db-attribute-path="BODY"/>
    > > </obj-entity>
    > >
    > > Thanks for your attention.
    > >
    > > Best regares,
    > >
    > > Giulio Cesare Solaroli
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Jan 26 2005 - 10:33:05 EST