0 Replies Latest reply on Feb 27, 2006 12:08 PM by Ralf Alt

    BLOB column

    Ralf Alt Newbie

      Hallo,

      my entity has an BLOB (MSSQL Server TEXT datatype). After storing I will execute the refresh() Methode of the entity manager.

      I get the following error:
      INFO [STDOUT] org.hibernate.exception.GenericJDBCException: could not load an entity: [de.orgacard.ejb.entity.Participant#21662]
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1796)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2729)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:123)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:39)
      at org.hibernate.impl.SessionImpl.fireRefresh(SessionImpl.java:824)
      at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:814)
      at org.hibernate.ejb.AbstractEntityManagerImpl.refresh(AbstractEntityManagerImpl.java:160)
      at org.jboss.ejb3.entity.InjectedEntityManager.refresh(InjectedEntityManager.java:112)
      at de.orgacard.ejb.bean.BasicBean.reload(BasicBean.java:150)
      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:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:189)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
      at $Proxy253.reload(Unknown Source)
      at de.orgacard.ejb.test.ParticipantBeanTest.testStore(ParticipantBeanTest.java:171)
      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:585)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at org.junitee.runner.TestRunner.run(TestRunner.java:108)
      at org.junitee.servlet.JUnitEEServlet.runTests(JUnitEEServlet.java:234)
      at org.junitee.servlet.JUnitEEServlet.doGet(JUnitEEServlet.java:203)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.
      at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.getTimestamp(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.getTimestamp(Unknown Source)
      at org.jboss.resource.adapter.jdbc.WrappedResultSet.getTimestamp(WrappedResultSet.java:440)
      at org.hibernate.type.TimestampType.get(TimestampType.java:30)
      at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
      at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
      at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
      at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:1898)
      at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1372)
      at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1300)
      at org.hibernate.loader.Loader.getRow(Loader.java:1197)
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
      at org.hibernate.loader.Loader.doQuery(Loader.java:689)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
      ... 71 more
      17:58:54,562 INFO [STDOUT] org.hibernate.exception.GenericJDBCException: could not load an entity: [de.orgacard.ejb.entity.Participant#21662]
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1796)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2729)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:123)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:39)
      at org.hibernate.impl.SessionImpl.fireRefresh(SessionImpl.java:824)
      at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:814)
      at org.hibernate.ejb.AbstractEntityManagerImpl.refresh(AbstractEntityManagerImpl.java:160)
      at org.jboss.ejb3.entity.InjectedEntityManager.refresh(InjectedEntityManager.java:112)
      at de.orgacard.ejb.bean.BasicBean.reload(BasicBean.java:150)
      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:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:189)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
      at $Proxy253.reload(Unknown Source)
      at de.orgacard.ejb.test.ParticipantBeanTest.testStore(ParticipantBeanTest.java:171)
      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:585)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at org.junitee.runner.TestRunner.run(TestRunner.java:108)
      at org.junitee.servlet.JUnitEEServlet.runTests(JUnitEEServlet.java:234)
      at org.junitee.servlet.JUnitEEServlet.doGet(JUnitEEServlet.java:203)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.
      at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.getTimestamp(Unknown Source)
      at com.microsoft.jdbc.base.BaseResultSet.getTimestamp(Unknown Source)
      at org.jboss.resource.adapter.jdbc.WrappedResultSet.getTimestamp(WrappedResultSet.java:440)
      at org.hibernate.type.TimestampType.get(TimestampType.java:30)
      at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
      at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
      at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
      at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:1898)
      at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1372)
      at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1300)
      at org.hibernate.loader.Loader.getRow(Loader.java:1197)
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
      at org.hibernate.loader.Loader.doQuery(Loader.java:689)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
      ... 71 more

      In the mircorsoft knowledge base I found the following article
      http://support.microsoft.com/default.aspx?scid=kb;en-us;824106

      This error occurs with ResultSet objects that contain a BLOB column (for example, text, ntext, or image data types). The driver cannot return a BLOB column out of order because it does not cache all the content of BLOB data types because of size limitations.
      For any row in the ResultSet, you can read any column from left to right, and each column should be read only one time. If you try to read columns out of order, or if you re-read a column from the ResultSet, you may receive the error message that the "Symptoms" section describes.
      To prevent the problem, read the ResultSet columns in order.

      What can I do?

      Thanks
      Ralf