db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Litchfield <...@csh.rit.edu>
Subject Re: problem in insertion of CLOB..
Date Thu, 06 Mar 2003 13:26:17 GMT
This is a problem with the Oracle thin driver, if you use the OCI driver
it should work fine.  I have also heard, but not confirmed, that this has
been fixed in a newer version of Oracle Database and drivers, although I
can't give you a version number.

-Ben




-- 

On Thu, 6 Mar 2003, Bill Schneider wrote:

> This appears to be an issue internal to Village and the way it uses the
> underlying JDBC driver.  You can't use PreparedStatement.setString to bind
> values bigger than 4k with Oracle, even if the actual DB data type supports
> values bigger than that.  I'm not sure if this is also a problem with the
> OCI driver, or only the thin driver.
>
> In raw JDBC this can be solved by replacing
>
> stmt.setString(foo)
>
> with
>
> stmt.setCharacterStream(new java.io.StringReader(foo));
>
> -- Bill
> ----- Original Message -----
> From: "Pranav Panpalia" <pranav@yodlee.com>
> To: <torque-user@db.apache.org>
> Sent: Thursday, March 06, 2003 7:00 AM
> Subject: problem in insertion of CLOB..
>
>
> > Hi,
> > I'm a novice torque user.I'm trying to insert aruond 8MB long string in a
> > column having datatype as clob.(Database is Oracle).
> > While running the program to do insertion following error is encountered.
> >
> > caught exception :java.sql.SQLException: Data size bigger than max size
> for
> > this type: 8419186
> >         at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
> >         at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
> >         at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:829)
> >         at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:82)
> >         at
> >
> oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1654)
> >         at
> >
> oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.j
> > ava:745)
> >         at
> >
> oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement
> > .java:1083)
> >         at com.workingdogs.village.Value.setPreparedStatementValue(Unknown
> > Source)
> >         at com.workingdogs.village.Record.saveWithInsert(Unknown Source)
> >         at com.workingdogs.village.Record.save(Unknown Source)
> >         at com.workingdogs.village.Record.save(Unknown Source)
> >         at
> > org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:891)
> >         at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:725)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:195)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:480)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:313)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:275)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:255)
> >         at TestClob.main(TestClob.java:47)
> > rethrown as org.apache.torque.TorqueException: Data size bigger than max
> > size for this type: 8419186
> >         at
> > org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:895)
> >         at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:725)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:195)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:480)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:313)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:275)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:255)
> >         at TestClob.main(TestClob.java:47)
> > rethrown as org.apache.torque.TorqueException: Data size bigger than max
> > size for this type: 8419186
> >         at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:729)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:195)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTestPeer.doInsert(BaseFmHtmlDumpTestPe
> > er.java:480)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:313)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:275)
> >         at
> >
> fm.TestTorque.torque.om.BaseFmHtmlDumpTest.save(BaseFmHtmlDumpTest.java:255)
> >         at TestClob.main(TestClob.java:47)
> >
> >
> > As clob supports data size upto 4GB, so insertion of around 8MB data
> should
> > not be a problem.Is there any special way to handle LOBs through torque ??
> > In my program I'm just passing the String containing all the data as an
> > argument to setXXX method provided in "Base" class.
> > Can anyone please help ??
> >
> >
> > Thanks
> > Pranav
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


Mime
View raw message