-->
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.  [ 4 posts ] 
Author Message
 Post subject: relation ship problem :transientInstance exception, ver 3.0
PostPosted: Sun Aug 07, 2005 5:56 am 
Newbie

Joined: Mon Jun 06, 2005 10:11 am
Posts: 14
hi,
I have following relation ship

Contact has one -many relation ship with ContactAddress

I have specified it in Contact.hbm.xml

ContactAddress has many - one relation ship with Address.

When I try to save Contact I get an exception
transientInstance exception for Address and it says save the Address first

Isnt automatically handled by hibernate,
Please let me know if I am missing something.

Regds
Ashwani


Top
 Profile  
 
 Post subject: Re: relation ship problem :transientInstance exception, ver
PostPosted: Sun Aug 07, 2005 7:21 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
ashwanik wrote:
hi,
I have following relation ship

Contact has one -many relation ship with ContactAddress

I have specified it in Contact.hbm.xml

ContactAddress has many - one relation ship with Address.

When I try to save Contact I get an exception
transientInstance exception for Address and it says save the Address first

Isnt automatically handled by hibernate,
Please let me know if I am missing something.

Regds
Ashwani


http://www.hibernate.org/ForumMailingli ... AskForHelp

Please include your code and the stack trace of the exception you're getting.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:33 am 
Newbie

Joined: Mon Jun 06, 2005 10:11 am
Posts: 14
I am using the workaround , I am first saving the parent ie Address. Its now working. Should Hibernate handle this automatically is the question. The stack trace will be now difficult to reproduce, I have shown the same message that I get from Hibernate.

TransientObject Exception [com. package of the class] . Save the Address first.



Regds
Ashwani


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 9:06 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
ashwanik wrote:
I am using the workaround , I am first saving the parent ie Address. Its now working. Should Hibernate handle this automatically is the question. The stack trace will be now difficult to reproduce, I have shown the same message that I get from Hibernate.

TransientObject Exception [com. package of the class] . Save the Address first.



Regds
Ashwani


This is a rather straightforward situation and Hibernate handles it but nobody will be able to tell you what you are doing wrong if you aren't willing to provide the necessary information.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


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