Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate 2: hsess.refresh(book); (or "is anything changed in the db")  RSS feed

John Landon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say I have 2 fields in book. I retrieved book from the db. Changed one of the fields using a set method of the class. Now, some other process might have changed the other field and persisted the book into the db.
So now I want to check if this happened. what I want to do is hsess.refresh(book) to get the updated version form the db do verify that the second field has the value I need. But what I am afraid off is that the first field that I changed in this thread will be overridden. I want to get all the fields of the object but not to override the ones I just changed.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!