From: <leg...@at...> - 2003-12-17 11:26:10
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-559 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-559 Summary: SQLServer "can not re-read row data..." exception in one-to-many Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Reporter: Bodo Junglas Created: Wed, 17 Dec 2003 5:25 AM Updated: Wed, 17 Dec 2003 5:25 AM Environment: Windows 2000/XP, JBoss 3.2.3 Description: 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. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |