RE: Oracle LOB problem

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Nov 10 2004 - 17:35:02 EST

  • Next message: Derek Rendall: "Re: Composite objects"

    Cris,

    Could you please open a bug report with sample code?

    This is supposed to work, and in my test cases Oracle adapter does the
    right thing when it encounters a BLOB (using EMPTY_BLOB() and all that)...
    So you may have some special case where that we are not handling well.

    Thanks
    Andrus

    > I am using the Oracle adapter. I've also written some JDBC direct code
    > using the style I showed before to successfully write the same blob I'm
    > trying to write in this example. The DbEntity def is:
    >
    > <db-entity name="DOCUMENT_FULL_TEXT_FILE">
    > <db-attribute name="BL_ATTACHMENT" type="BLOB"
    > length="20000000"/>
    > <db-attribute name="NU_FULL_TEXT_ID" type="INTEGER"
    > isPrimaryKey="true" isMandatory="true" length="7"/>
    > </db-entity>
    >
    > The stack trace I'm seeing is..
    >
    > org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1RC1 October 3
    > 2004] Commit Exception
    > at
    > org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:12
    > 40)
    > at
    > org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:12
    > 01)
    > [snip]
    > at
    > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    > at
    > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
    > a:683)
    > at java.lang.Thread.run(Thread.java:534)
    > Caused by: java.sql.SQLException: Data size bigger than max size for
    > this type: 165888
    > 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:95)
    > at
    > oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
    > at
    > oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
    > ava:1134)
    > at
    > oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.
    > java:2170)
    > at
    > org.objectstyle.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArrayTy
    > pe.java:212)
    > at
    > org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:544)
    > at
    > org.objectstyle.cayenne.access.trans.BatchQueryBuilder.bindParameters(BatchQ
    > ueryBuilder.java:143)
    > at
    > org.objectstyle.cayenne.access.DataNode.runBatchUpdateAsBatch(DataNode.java:
    > 534)
    > at
    > org.objectstyle.cayenne.dba.oracle.OracleDataNode.runBatchUpdateAsBatch(Orac
    > leDataNode.java:355)
    > at
    > org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:498)
    > 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:12
    > 31)
    > ... 40 more
    >
    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: Wednesday, November 10, 2004 4:39 PM
    > To: cayenne-use..bjectstyle.org
    > Subject: Re: Oracle LOB problem
    >
    > Cayenne uses "EMPTY_CLOB()" or "EMPTY_BLOB()" as appropriate. Are you
    > sure you have OracleAdapter selected for your project? Do you see any
    > errors?
    >
    > Andrus
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Nov 10 2004 - 17:35:04 EST