A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
transient instance - save the transient instance before flushing
Joined: Jul 15, 2005
Sep 28, 2006 15:49:00
I am getting the following error message when I try to update/add a new record in table A.
: 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" />
<!-- Table A config -->
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.
Joined: Sep 28, 2006
Oct 10, 2006 04:20:00
you try to use cascade attribute
or else call the DAOs (seperately)properly
the reason fo this problem is object is not send to persistence
state and you are flushing it before saving
I agree. Here's the link:
subject: transient instance - save the transient instance before flushing
Legacy and Hibernate1-2-M Mapping
Need many-to-one mapping help
Many-to-many composite ID
Many to Many with out primary keys
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013