First, a big Thanks to the developers of Spring! It's made my job much easier!
I'm having problems using the OracleLobHandler. I have a CLOB field in my database that is mapped to a String in hibernate domain object using ClobStringType. When I call saveOrUpdate() on the object, I get the error below. Stepping through the call to setClobAsString() reveals that the error occurs b/c of an IO error at line 267 of OracleLobHandler.java - at writer.flush()... It looks as though the database connection is closed..?! Any ideas?
Thanks in advance,
Joe
=====>
org.springframework.dao.DataAccessResourceFailureException: Could not create Oracle LOB; nested exception is java.io.IOException: No more data to read from socket
java.io.IOException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:204)
at org.springframework.jdbc.support.lob.OracleLobHandler$3.populateLob(OracleLobHandler.java:268)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.createLob(OracleLobHandler.java:335)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.setClobAsString(OracleLobHandler.java:262)
at org.springframework.orm.hibernate.support.ClobStringType.nullSafeSet(ClobStringType.java:87)
at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:386)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:316)
....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Strange, I've never seen that error before. I'm using OracleLobHandler with ClobStringType myself, and it works nicely - on Oracle 9i, with the Oracle 9i JDBC driver. What database and driver version are you using? Do you get that exception every time or just in specific cases?
Juergen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all -
First, a big Thanks to the developers of Spring! It's made my job much easier!
I'm having problems using the OracleLobHandler. I have a CLOB field in my database that is mapped to a String in hibernate domain object using ClobStringType. When I call saveOrUpdate() on the object, I get the error below. Stepping through the call to setClobAsString() reveals that the error occurs b/c of an IO error at line 267 of OracleLobHandler.java - at writer.flush()... It looks as though the database connection is closed..?! Any ideas?
Thanks in advance,
Joe
=====>
org.springframework.dao.DataAccessResourceFailureException: Could not create Oracle LOB; nested exception is java.io.IOException: No more data to read from socket
java.io.IOException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:204)
at org.springframework.jdbc.support.lob.OracleLobHandler$3.populateLob(OracleLobHandler.java:268)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.createLob(OracleLobHandler.java:335)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.setClobAsString(OracleLobHandler.java:262)
at org.springframework.orm.hibernate.support.ClobStringType.nullSafeSet(ClobStringType.java:87)
at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:386)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:316)
....
Strange, I've never seen that error before. I'm using OracleLobHandler with ClobStringType myself, and it works nicely - on Oracle 9i, with the Oracle 9i JDBC driver. What database and driver version are you using? Do you get that exception every time or just in specific cases?
Juergen