-->
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: refresh() throw exception
PostPosted: Thu Oct 18, 2007 10:27 am 
Newbie

Joined: Tue May 22, 2007 3:39 am
Posts: 15
Hello.

I have scenario:

session.persist(obj);
....
session.refresh(obj);

In this case Hibernate call exception that in DB not exist rows with id...

but

session.persist(obj);
session.flush();
...
session.refresh()

is all right.

Is this opportunely behaviour or bug ?

Thanks in advance
gienas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 19, 2007 1:51 am 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Flush and refresh work in different directions.

Flush synchronize the state in memory to the db.
Refresh basically reloads the object from the db.

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


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.