java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.

Hibernate JIRA | Bodo Junglas | 1 decade ago
  1. 0

    PAttributedEntity has a non-lazy one-to-many relation to PAttributeInstance mapped as java.util.Set PAttributedEntity has joined-subclasses (don't know if that is important here). If I load one of these subclasses from SQLServer using the Mircosoft JDBC driver I get: 12:14:06,706 DEBUG [SessionImpl] collection not cached 12:14:06,706 DEBUG [SessionImpl] done materializing entity [de.objectcode.canyon.persistent.instance.PProcessInstance#10] 12:14:06,706 DEBUG [SessionImpl] initializing non-lazy collections 12:14:06,706 DEBUG [SessionImpl] initializing collection [de.objectcode.canyon.persistent.instance.PAttributedEntity.attributesSet#10] 12:14:06,706 DEBUG [BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets 12:14:06,706 DEBUG [BatcherImpl] prepared statement get: select attributes0_.ATTRIBUTEINSTANCEID as ATTRIBUT1___, attributes0_.OWNERID as OWNERID__, attributes0 _.ATTRIBUTEINSTANCEID as ATTRIBUT1_0_, attributes0_.BOOLVALUE as BOOLVALUE0_, attributes0_.DATAVALUE as DATAVALUE0_, attributes0_.DBLVALUE as DBLVALUE0_, attrib utes0_.INTVALUE as INTVALUE0_, attributes0_.STRVALUE as STRVALUE0_, attributes0_.OBJVALUE as OBJVALUE0_, attributes0_.TYPE as TYPE0_, attributes0_.NAME as NAME0 _ from PATTRIBUTEINSTANCES attributes0_ where attributes0_.OWNERID=? 12:14:06,706 DEBUG [BatcherImpl] preparing statement 12:14:06,706 DEBUG [LongType] binding '10' to parameter: 1 12:14:06,736 DEBUG [Loader] result set contains (possibly empty) collection: [de.objectcode.canyon.persistent.instance.PAttributedEntity.attributesSet#10] 12:14:06,736 DEBUG [SessionImpl] uninitialized collection: initializing 12:14:06,736 DEBUG [Loader] processing result set 12:14:06,736 INFO [STDOUT] >>>>>>>> ATTRIBUT1_0_ 3 ATTRIBUT1_0_ ATTRIBUT1_0_ 12:14:06,736 DEBUG [LongType] returning '7' as column: ATTRIBUT1_0_ 12:14:06,736 DEBUG [Loader] result row: 7 12:14:06,736 DEBUG [Loader] Initializing object from ResultSet: 7 12:14:06,736 DEBUG [Loader] Hydrating entity: de.objectcode.canyon.persistent.instance.PAttributeInstance#7 12:14:06,736 DEBUG [BooleanType] returning null as column: BOOLVALUE0_ 12:14:06,736 DEBUG [TimestampType] returning null as column: DATAVALUE0_ 12:14:06,736 DEBUG [DoubleType] returning null as column: DBLVALUE0_ 12:14:06,736 DEBUG [IntegerType] returning null as column: INTVALUE0_ 12:14:06,736 DEBUG [StringType] returning 'WorkFlowSink' as column: STRVALUE0_ 12:14:06,736 DEBUG [IntegerType] returning '0' as column: TYPE0_ 12:14:06,736 DEBUG [StringType] returning 'starterUserID' as column: NAME0_ 12:14:06,736 INFO [STDOUT] >>>>>>>> OWNERID__ 2 OWNERID__ OWNERID__ 12:14:06,736 DEBUG [JDBCExceptionReporter] SQL Exception 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.getLong(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getLong(Unknown Source) at de.objectcode.jdbcfix.ResultSetFix.getLong(ResultSetFix.java:444) at net.sf.hibernate.type.LongType.get(LongType.java:18) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.collection.AbstractCollectionPersister.readKey(AbstractCollectionPersister.java:379) at net.sf.hibernate.loader.Loader.readCollectionElement(Loader.java:282) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:214) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:128) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:905) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:880) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:80) at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284) at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3131) at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:331) at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3005) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) at net.sf.hibernate.loader.Loader.list(Loader.java:918) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45) at de.objectcode.canyon.persistent.instance.InstanceRepository.findProcessInstances(InstanceRepository.java:306) at de.objectcode.canyon.jmx.admin.ProcessAdmin.listProcessInstances(ProcessAdmin.java:111) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ ... much much more JBoss related stuff ... ] Obviously Hibernate accesses the columns in the ResultSet in the wrong order, i.e. first columns 3,4,5,6,7,8,9,10,11 then column 2. The MS-Driver might be a little bit prissy here, but if I remember die JDBC-Spec right a ResultSet is not obliged to allow column access in arbirary order. So I think this is indeed a bug in Hibernate.

    Hibernate JIRA | 1 decade ago | Bodo Junglas
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.
  2. 0

    PAttributedEntity has a non-lazy one-to-many relation to PAttributeInstance mapped as java.util.Set PAttributedEntity has joined-subclasses (don't know if that is important here). If I load one of these subclasses from SQLServer using the Mircosoft JDBC driver I get: 12:14:06,706 DEBUG [SessionImpl] collection not cached 12:14:06,706 DEBUG [SessionImpl] done materializing entity [de.objectcode.canyon.persistent.instance.PProcessInstance#10] 12:14:06,706 DEBUG [SessionImpl] initializing non-lazy collections 12:14:06,706 DEBUG [SessionImpl] initializing collection [de.objectcode.canyon.persistent.instance.PAttributedEntity.attributesSet#10] 12:14:06,706 DEBUG [BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets 12:14:06,706 DEBUG [BatcherImpl] prepared statement get: select attributes0_.ATTRIBUTEINSTANCEID as ATTRIBUT1___, attributes0_.OWNERID as OWNERID__, attributes0 _.ATTRIBUTEINSTANCEID as ATTRIBUT1_0_, attributes0_.BOOLVALUE as BOOLVALUE0_, attributes0_.DATAVALUE as DATAVALUE0_, attributes0_.DBLVALUE as DBLVALUE0_, attrib utes0_.INTVALUE as INTVALUE0_, attributes0_.STRVALUE as STRVALUE0_, attributes0_.OBJVALUE as OBJVALUE0_, attributes0_.TYPE as TYPE0_, attributes0_.NAME as NAME0 _ from PATTRIBUTEINSTANCES attributes0_ where attributes0_.OWNERID=? 12:14:06,706 DEBUG [BatcherImpl] preparing statement 12:14:06,706 DEBUG [LongType] binding '10' to parameter: 1 12:14:06,736 DEBUG [Loader] result set contains (possibly empty) collection: [de.objectcode.canyon.persistent.instance.PAttributedEntity.attributesSet#10] 12:14:06,736 DEBUG [SessionImpl] uninitialized collection: initializing 12:14:06,736 DEBUG [Loader] processing result set 12:14:06,736 INFO [STDOUT] >>>>>>>> ATTRIBUT1_0_ 3 ATTRIBUT1_0_ ATTRIBUT1_0_ 12:14:06,736 DEBUG [LongType] returning '7' as column: ATTRIBUT1_0_ 12:14:06,736 DEBUG [Loader] result row: 7 12:14:06,736 DEBUG [Loader] Initializing object from ResultSet: 7 12:14:06,736 DEBUG [Loader] Hydrating entity: de.objectcode.canyon.persistent.instance.PAttributeInstance#7 12:14:06,736 DEBUG [BooleanType] returning null as column: BOOLVALUE0_ 12:14:06,736 DEBUG [TimestampType] returning null as column: DATAVALUE0_ 12:14:06,736 DEBUG [DoubleType] returning null as column: DBLVALUE0_ 12:14:06,736 DEBUG [IntegerType] returning null as column: INTVALUE0_ 12:14:06,736 DEBUG [StringType] returning 'WorkFlowSink' as column: STRVALUE0_ 12:14:06,736 DEBUG [IntegerType] returning '0' as column: TYPE0_ 12:14:06,736 DEBUG [StringType] returning 'starterUserID' as column: NAME0_ 12:14:06,736 INFO [STDOUT] >>>>>>>> OWNERID__ 2 OWNERID__ OWNERID__ 12:14:06,736 DEBUG [JDBCExceptionReporter] SQL Exception 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.getLong(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getLong(Unknown Source) at de.objectcode.jdbcfix.ResultSetFix.getLong(ResultSetFix.java:444) at net.sf.hibernate.type.LongType.get(LongType.java:18) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.collection.AbstractCollectionPersister.readKey(AbstractCollectionPersister.java:379) at net.sf.hibernate.loader.Loader.readCollectionElement(Loader.java:282) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:214) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:128) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:905) at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:880) at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:80) at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284) at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3131) at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:331) at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3005) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) at net.sf.hibernate.loader.Loader.list(Loader.java:918) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45) at de.objectcode.canyon.persistent.instance.InstanceRepository.findProcessInstances(InstanceRepository.java:306) at de.objectcode.canyon.jmx.admin.ProcessAdmin.listProcessInstances(ProcessAdmin.java:111) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ ... much much more JBoss related stuff ... ] Obviously Hibernate accesses the columns in the ResultSet in the wrong order, i.e. first columns 3,4,5,6,7,8,9,10,11 then column 2. The MS-Driver might be a little bit prissy here, but if I remember die JDBC-Spec right a ResultSet is not obliged to allow column access in arbirary order. So I think this is indeed a bug in Hibernate.

    Hibernate JIRA | 1 decade ago | Bodo Junglas
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.
  3. 0

    Here's the sequence to get this re-create this problem. 1) install orion server 2) get release 1 jdbc drivers from microsoft 3) install confluence under orion 4) define data-sources in orion 5) create empty db in ms sql server 6) startup orion, setup confluence to point to new empty db 7) login to confluence after setup, create 1 space 8) exit confluence, shutdown orion and restart 9) try to access confluence and get this error: org.springframework.jdbc.UncategorizedSQLException: (HibernateAccessor): encountered SQLException [[Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.]; nested exception is java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2. From microsoft, the problem is the following: For nvarchar,image,text types the driver throws exception when the order you retrieved is differ from the order you access the result There are three tables in confluence with type 'Text' - CONTENT, EMAILTEMPLATES, and PAGETEMPLATES. I'm guessing the problem is with one of these tables. Here is more of the server log error: 2004-06-18 17:47:55,805 WARN [sf.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: HY010 2004-06-18 17:47:55,806 ERROR [sf.hibernate.util.JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2. 2004-06-18 17:47:55,807 WARN [sf.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: HY010 2004-06-18 17:47:55,808 ERROR [sf.hibernate.util.JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2. 2004-06-18 17:47:55,812 ERROR [sf.hibernate.util.JDBCExceptionReporter] could not load: [com.atlassian.confluence.spaces.SpaceDescription#1] 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.getLong(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.getLong(Unknown Source) at net.sf.hibernate.type.LongType.get(LongType.java:18)

    Atlassian JIRA | 1 decade ago | William Crighton [CCC]
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 2.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Resultset being re-read in JMS JDBC store causing Exception

    Google Groups | 1 decade ago | Quantos Quattro
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 1.
  6. 0

    JMS Store Exception with MS SQL Server in Win2K

    Google Groups | 1 decade ago | Thierry
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 1.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. com.microsoft.jdbc
      BaseResultSet.getLong
      1. com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      2. com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      3. com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
      4. com.microsoft.jdbc.base.BaseResultSet.getLong(Unknown Source)
      5. com.microsoft.jdbc.base.BaseResultSet.getLong(Unknown Source)
      5 frames
    3. de.objectcode.jdbcfix
      ResultSetFix.getLong
      1. de.objectcode.jdbcfix.ResultSetFix.getLong(ResultSetFix.java:444)
      1 frame
    4. net.sf.hibernate
      QueryImpl.list
      1. net.sf.hibernate.type.LongType.get(LongType.java:18)
      2. net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
      3. net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
      4. net.sf.hibernate.collection.AbstractCollectionPersister.readKey(AbstractCollectionPersister.java:379)
      5. net.sf.hibernate.loader.Loader.readCollectionElement(Loader.java:282)
      6. net.sf.hibernate.loader.Loader.doQuery(Loader.java:214)
      7. net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:128)
      8. net.sf.hibernate.loader.Loader.loadCollection(Loader.java:905)
      9. net.sf.hibernate.loader.Loader.loadCollection(Loader.java:880)
      10. net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:80)
      11. net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
      12. net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3131)
      13. net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:331)
      14. net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3005)
      15. net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
      16. net.sf.hibernate.loader.Loader.list(Loader.java:918)
      17. net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983)
      18. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473)
      19. net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45)
      19 frames
    5. de.objectcode.canyon
      ProcessAdmin.listProcessInstances
      1. de.objectcode.canyon.persistent.instance.InstanceRepository.findProcessInstances(InstanceRepository.java:306)
      2. de.objectcode.canyon.jmx.admin.ProcessAdmin.listProcessInstances(ProcessAdmin.java:111)
      2 frames
    6. Java RT
      NativeMethodAccessorImpl.invoke0
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      1 frame