[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5706) Incorrect accounting for 1-based LOB offsets

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Nov 1 10:10:48 EDT 2010


Incorrect accounting for 1-based LOB offsets
--------------------------------------------

                 Key: HHH-5706
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5706
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.0
         Environment: 

            Reporter: Steve Ebersole
            Assignee: Steve Ebersole
             Fix For: 3.6.1


There is a mismatch in how streams and JDBC LOBs define offsets.  Stream offsets are 0-based; LOB offsets are 1-based.  There appears to be a problem in the code accounting for the mistmatch.

{noformat}
java.lang.Exception: could not save object File_$$_javassist_11#5455
	at com.soda.mb.application.persistence.dao.BaseDAO.save(BaseDAO.java:112)
	at com.soda.mb.application.persistence.dao.BaseDAO.save(BaseDAO.java:88)
	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:597)
	at com.soda.mb.application.persistence.DAOHandler.invoke(DAOHandler.java:38)
	at $Proxy39.save(Unknown Source)
	at com.soda.mb.application.services.FileService.saveFile(FileService.java:54)
	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:597)
	at com.soda.mb.application.PublicServiceFacade$ServiceHandler.invoke(PublicServiceFacade.java:107)
	at $Proxy38.saveFile(Unknown Source)
	at com.soda.mb.views.pages.admin.AdminFilesPage.saveObject(AdminFilesPage.java:91)
	at com.soda.mb.views.pages.admin.AdminFilesPage.saveObject(AdminFilesPage.java:23)
	at com.soda.mb.views.pages.objectlist.ObjectListEditPage$ObjectEditForm.onSubmit(ObjectListEditPage.java:186)
	at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1565)
	at org.apache.wicket.markup.html.form.Form.process(Form.java:958)
	at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:920)
	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:597)
	at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
	at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
	at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
	at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
	at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
	at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
	at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
	at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.soda.mb.application.persistence.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:40)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.soda.mb.application.businessobjects.FileData]
	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2436)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2856)
	at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
	at com.soda.mb.application.persistence.dao.BaseDAO.save(BaseDAO.java:99)
	... 48 more
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: org.hibernate.HibernateException: IOException occurred reading a binary value
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
	at com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(NewPooledConnection.java:432)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setBlob(NewProxyPreparedStatement.java:509)
	at org.hibernate.type.descriptor.sql.BlobTypeDescriptor$1.doBind(BlobTypeDescriptor.java:65)
	at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:89)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:282)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277)
	at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:85)
	at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2412)
	... 57 more
Caused by: org.hibernate.HibernateException: IOException occurred reading a binary value
	at org.hibernate.type.descriptor.java.DataHelper.extractBytes(DataHelper.java:195)
	at org.hibernate.engine.jdbc.BlobProxy.invoke(BlobProxy.java:137)
	at $Proxy44.getBytes(Unknown Source)
	at com.mysql.jdbc.PreparedStatement.setBlob(PreparedStatement.java:2807)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setBlob(NewProxyPreparedStatement.java:495)
	... 64 more
Caused by: java.io.IOException: Tentative de déplacement du pointeur de fichier avant le début du fichier
	at java.io.FileInputStream.skip(Native Method)
	at org.hibernate.type.descriptor.java.DataHelper.extractBytes(DataHelper.java:172)
	... 68 more
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list