Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC Driver/prepared Statement

400049Oct 23 2003 — edited Oct 25 2003
i found that the Oracle JDBC Thin Driver(9.0.2.0.0) seems to have a problem with larget strings.
i inserted a very large string nto a VARCHAR(1024) field.
when the inserted string has more than about 4kb then the follwing exception is thrown when the string property is set into a prepared statement.

500 Servlet Exception

java.sql.SQLException: Datengr��e gr��er als max. Gr��e f�r diesen Typ:
230967
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 org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:243)
at net.sf.hibernate.type.StringType.set(StringType.java:22)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:367)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:472)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:450)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2073)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:261)
...

The problem is that the exception seems to be broken afterwards. i always get
the following exception:
java.sql.SQLException: Geschlossene Anweisung
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:6648)
at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java:747)
at oracle.jdbc.driver.OracleConnection.commit(OracleConnection.java:1372)

executing a rollback before using it again, dot not help.

an intersting thing is that if the inserted string is smaller than 4kb the following exception is thrown and the connection is
not broken:

--------------------------------------------------------------------------------------------------------------

500 Servlet Exception
java.sql.BatchUpdateException: ORA-01401: Eingef�gter Wert zu gro� f�r
Spalte

at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:4133)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeBatch(DelegatingPreparedStatement.java:231)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:96)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2104)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2073)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2017)
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:261)
...

is this a bug in the jdbc driver?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2003
Added on Oct 23 2003
11 comments
1,168 views