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: how to save 2 objects in the session and transaction
PostPosted: Tue Aug 03, 2004 11:56 am 
Newbie

Joined: Tue Aug 03, 2004 9:28 am
Posts: 2
Hi guys,

I'm trying to saveOrUpdate 2 different objectsin the same session like this:

while{
tx = session.beginTransaction();
session.saveOrUpdate(employee);
session.saveOrUpdate(employeeYear);
}
tx.commit();

And I got only the table employee updated and nothing happen for the 2nd table (employeeYear)

What am I doing wrong?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 1:02 pm 
Beginner
Beginner

Joined: Thu Jul 22, 2004 2:15 pm
Posts: 35
no log messages?

no new rows in the second table?

no hibernate sql?

you must have something.. I don't see why this is not working.. and there is nothing for me to look at either to see why it might not be working..

Pritpal Dhaliwal


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 3:25 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
maybe your second object hasn't be modified - Hibernate will not issue any update statement for it...

if you want to understand a bit more what Hibernate is doing, you can turn the sql output on and eventually increase log level.


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.