I'm trying to insert the binary content in a blob column.
My table is very simple:
CREATE TABLE TEST
(
ID NUMBER(16),
CONTENT BLOB
)
I get the following error. Please help!
INFO net.sf.hibernate.cfg.Environment - Hibernate 2.0.3
INFO net.sf.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.query.imports=net.sf.hibernate.test, net.sf.hibernate.eg, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=cms3, hibernate.connection.url=jdbc:oracle:thin:@10.0.0.131:1521:CMS, hibernate.show_sql=true, hibernate.connection.password=cms3, hibernate.statement_cache.size=25, hibernate.connection.pool_size=1}
INFO net.sf.hibernate.cfg.Environment - using java.io streams to persist binary types
INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
INFO net.sf.hibernate.cfg.Environment - JVM proxy support: true
INFO net.sf.hibernate.cfg.Configuration - Mapping resource: de/ems/cms/beans/Testu.hbm.xml
INFO net.sf.hibernate.cfg.Binder - Mapping class: de.ems.cms.beans.Testu -> TEST
INFO net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
INFO net.sf.hibernate.cfg.Configuration - processing foreign key constraints
INFO net.sf.hibernate.impl.SessionFactoryImpl - building session factory
INFO net.sf.hibernate.dialect.Dialect - Using dialect: net.sf.hibernate.dialect.OracleDialect
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@10.0.0.131:1521:CMS
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=cms3, password=cms3}
INFO net.sf.hibernate.ps.PreparedStatementCache - prepared statement cache size: 25
INFO net.sf.hibernate.impl.SessionFactoryImpl - Use outer join fetching: true
INFO net.sf.hibernate.impl.SessionFactoryImpl - Use scrollable result sets: true
INFO net.sf.hibernate.impl.SessionFactoryImpl - echoing all SQL to stdout
INFO net.sf.hibernate.impl.SessionFactoryObjectFactory - no JDNI name configured
INFO net.sf.hibernate.impl.SessionFactoryImpl - Query language substitutions: {no='N', true=1, yes='Y', false=0}
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: insert into CMS3.TEST (CONTENT, ID) values (?, ?)
WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 17410, SQLState: null
ERROR net.sf.hibernate.util.JDBCExceptionReporter - No more data to read from socket
ERROR net.sf.hibernate.util.JDBCExceptionReporter - Could not synchronize database state with session
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:944)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:741)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:700)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:373)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1839)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1764)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2354)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:421)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:454)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:57)
at ro.level7.common.db.directimpl.TransactionImpl.commit(TransactionImpl.java:28)
at de.ems.cms.util.Test.main(Test.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
ERROR net.sf.hibernate.transaction.JDBCTransaction - Rollback failed
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:944)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:741)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:700)
at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:108)
at oracle.jdbc.ttc7.TTC7Protocol.rollback(TTC7Protocol.java:401)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1073)
at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:80)
at ro.level7.common.db.directimpl.TransactionImpl.rollback(TransactionImpl.java:20)
at de.ems.cms.util.Test.main(Test.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
|