Hello,
I just switched from Oracle to MSSQL.
I'm using Hibernate in my Java programs.
After switching to MSQL und changing the jdbc driver used by hibernate to jtds I get the exception "java.sql.SQLException: I/O Error: Data in stream less than specified by length
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1049) ...". when I try to save a Blob. I never had this problem with oracle and I did not change anything in my program. I create this Blob with "(Hibernate.createBlob(attachment))".
Can anybody help me?
Regards
Bernd
Hibernate version: 3.0
Full stack trace of any exception that occurs:
2006-04-16 19:20:08,659 [main] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [de.bwfps.reklamgmt.model.reklamation.Anhang] [insert into REKLAMATION_ANHANG (RA_FILENAME, RA_OBJEKT, RA_TYPE, RA_MIMETYPE, RA_REKLAMATION) values (?, ?, ?, ?, ?)]
java.sql.SQLException: I/O Error: Data in stream less than specified by length
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1049)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:478)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:98)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1749)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2168)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:239)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:159)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:454)
at org.hibernate.engine.Cascades$5.cascade(Cascades.java:153)
at org.hibernate.engine.Cascades.cascade(Cascades.java:721)
at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:860)
at org.hibernate.engine.Cascades.cascade(Cascades.java:739)
at org.hibernate.engine.Cascades.cascade(Cascades.java:817)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:362)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:264)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:159)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:454)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:449)
at de.bwfps.reklamgmt.dao.ReklaDAO.insertNew(ReklaDAO.java:152)
at de.bwfps.reklamgmt.server.MailHandlerImpl.saveNewRekla(MailHandlerImpl.java:226)
at de.bwfps.reklamgmt.server.MailHandlerImpl.saveComplaintWithExcelForm(MailHandlerImpl.java:423)
at de.bwfps.reklamgmt.server.MailHandlerImpl.processAttachments(MailHandlerImpl.java:336)
at de.bwfps.reklamgmt.server.MailHandlerImpl.execute(MailHandlerImpl.java:209)
at de.bwfps.reklamgmt.server.MailMonitor$InboxListener.processMessageList(MailMonitor.java:1408)
at de.bwfps.reklamgmt.server.MailMonitor$InboxListener.preProcessInbox(MailMonitor.java:1130)
at de.bwfps.reklamgmt.server.MailMonitor.initInboxFolder(MailMonitor.java:492)
at de.bwfps.reklamgmt.server.MailMonitor.listen(MailMonitor.java:433)
at de.bwfps.reklamgmt.server.Server.startMailMonitor(Server.java:488)
at de.bwfps.reklamgmt.server.Server.start(Server.java:302)
at de.bwfps.reklamgmt.server.Launcher.start(Launcher.java:262)
at de.bwfps.reklamgmt.server.Launcher.main(Launcher.java:190)
Caused by: java.io.IOException: Data in stream less than specified by length
at net.sourceforge.jtds.jdbc.RequestStream.writeStreamBytes(RequestStream.java:383)
at net.sourceforge.jtds.jdbc.TdsData.writeParam(TdsData.java:2225)
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL70(TdsCore.java:3787)
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1029)
... 43 more
2006-04-16 19:20:08,705 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
2006-04-16 19:20:08,705 [main] ERROR org.hibernate.util.JDBCExceptionReporter - I/O Error: Data in stream less than specified by length
2006-04-16 19:21:10,049 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
2006-04-16 19:21:10,049 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
2006-04-16 19:21:10,049 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
2006-04-16 19:21:10,049 [main] ERROR org.hibernate.transaction.JDBCTransaction - JDBC rollback failed
|