-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: HibernateObjectRetrievalFailureException
PostPosted: Thu Nov 10, 2005 12:50 am 
Newbie

Joined: Wed Apr 06, 2005 11:41 am
Posts: 13
Hibernate version:

hibernate-3.1beta1.jar

Mapping documents:

I have class A and Class B
Class A contains a list of Class B and class B contains the reference of Class A

I have the following mapping for Class A and Class B

CLASS A
<hibernate-mapping>
<class name="A" table="A" dynamic-update="true" lazy="false">
<id name="id" column="A_ID" type="java.lang.Integer" unsaved-value="null">
<generator class="org.hibernate.id.TableHiLoGenerator">
<param name="table">UID_Sequence</param>
<param name="column">UID</param>
</generator>
</id>
<version name="version" column="OBJECT_VERSION" type="java.lang.Integer" unsaved-value="null"/>
<list name="list" cascade="all-delete-orphan" lazy="false">
<key column="A_B_ID" />
<index column="A_B_ORDER"/>
<one-to-many class="B"/>
</list>
</class>
</hibernate-mapping>

FOR CLASS B

<hibernate-mapping>
<class name="B" table="B">
<id name="id" column="B_ID" type="java.lang.Integer" unsaved-value="null">
<generator class="org.hibernate.id.TableHiLoGenerator">
<param name="table">UID_Sequence</param>
<param name="column">UID</param>
</generator>
</id>
<version name="version" column="OBJECT_VERSION" type="java.lang.Integer" unsaved-value="null"/>
<many-to-one name="a" class="A" column="A_B_ID"/>
</class>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Using Springs HibernateTemplate class to load and save class A


Full stack trace of any exception that occurs:

org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [B#1]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists:

Name and version of the database you are using:
HSQL DB
hsqldb-1.8.0-RC9.jar



Whenever I load and save class A in SQL Server 2000 it works fine. but for hSQL DB the loading fails with the above exception

Cant figure out whats wrong. I checked the DB it has the the data that were inserted in both the tables.


Thanks in advance


Top
 Profile  
 
 Post subject: Any takers
PostPosted: Fri Nov 11, 2005 1:30 am 
Newbie

Joined: Wed Apr 06, 2005 11:41 am
Posts: 13
Forgot to mention Hibernate is used along with Spring !!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 11, 2005 1:46 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
apparently there were some big changes when hsqldb went from 1.8 to 1.7. do you have the same problem using an older version ? you may also want to use a the latest rc for hibernate.


Top
 Profile  
 
 Post subject: I am using new version of HSQL DB
PostPosted: Sat Nov 12, 2005 2:59 am 
Newbie

Joined: Wed Apr 06, 2005 11:41 am
Posts: 13
I am using hsqldb-1.8.0-RC9.jar
And hibernate hibernate-3.1beta1.jar

Would this combination be a problem?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 3:07 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
i don't know, but after you try an older version we will both have a better idea ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.