-->
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.  [ 2 posts ] 
Author Message
 Post subject: transient instance - save the transient instance before flus
PostPosted: Fri Sep 29, 2006 10:13 am 
Newbie

Joined: Wed Jun 28, 2006 4:34 pm
Posts: 2
I am getting the following error message when I try to update/add a new record in table A.

javax.servlet.ServletException: object references an unsaved transient instance - save the transient instance before flushing: com.company.struts.project.ParentClass

I have two tables TableA & TableB. The relationship is TableB 1->many TableA. The configuration files are set accordingly.

<!-- Table B config -->
<set name="TableB" inverse="false">
<key column="SId" />
<one-to-many entity-name="TableA" />
</set>

<!-- Table A config -->
<many-to-one name="TableB"
column="SId" not-null="false"
entity-name="TableA" />

So, whenever I try to update the SId column in Table A (nullable) to set to Null (this value in not in Table B, as it is primary key), the above error is being thrown.

I am sorry if I was incoherent in my explanation. Any help is greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 9:42 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Quote:
<set name="TableB" inverse="false">


Set the inverse attribute to true:

Code:
<set name="TableB" inverse="true">


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.