-->
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.  [ 3 posts ] 
Author Message
 Post subject: transient instances getting nullified
PostPosted: Thu Nov 27, 2003 6:51 am 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
We have a web app runing in tomcat. When we reload app the session is persisted by tomcat. In the session we keep an instance of the currently logged on employee which is also an entity.

Normally if we go through the sequence

Code:
Customer c = new Customer();
c.setEmployee(employee); <---- from session
session.save(customer)


we get a new entry in our customers table with employee_id set correctly.

However, after a reload if we do the same thing, the employee_id is null.
Going through the code we find that the employee field is nullified in the method nullifyTransientReferences(). if the employee logoffs and logs on again evrything work ok.

can someone please explain what is happening here and if there is a way we can reuse the employee instance.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 6:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
(1) your unsaved-value mapping is probably wrong
(2) it looks like you forget to flush()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 7:50 am 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
yep, (1) was it. looks like struts is misbehaving and setting all our Integer instances to zero instead of null.

thanks


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