-->
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: Update automatically one Object from the database?
PostPosted: Mon Feb 15, 2010 1:14 pm 
Beginner
Beginner

Joined: Tue Aug 26, 2008 4:24 pm
Posts: 29
I have a problem. I dont know if it is normal but when I get an object from the database, for example, from the table Person, I change some properties of this object (name, height...) and the next I do is try to do a select from this table with some Criteria, Hibernate firsts does an "update" to the object I got from the database and after it does the select.

1. Why is it doing the update automatically if Iam not calling the update method?
2. How can I cancel the call to the update method?

Thanks


Top
 Profile  
 
 Post subject: Re: Update automatically one Object from the database?
PostPosted: Mon Feb 15, 2010 1:47 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
There is a chapter in the Hibernate documentation that describes why this is happening and what you can do to have more control. Read http://docs.jboss.org/hibernate/stable/ ... e-flushing


Top
 Profile  
 
 Post subject: Re: Update automatically one Object from the database?
PostPosted: Mon Feb 15, 2010 2:14 pm 
Newbie

Joined: Mon Feb 15, 2010 2:08 pm
Posts: 1
You need to change the Flush Mode from the default AUTO.


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.