• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is save reqiured for presistent objects? (can i make it required)

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's the thing:

assume that on a complex operation
i load a few objects from a session, then, during the manipulation of said objects i reach a descision not to save all of them, but only a few.

since hibernate tracks my changes, i cannot do so , calling flush and commit alone would automatically save all objects.
is there an easy way aside from evicting said object from the session.

i recall that in hibernate 2 this was not the case.

what's that the pattern in such a case?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there an easy way aside from evicting said object from the session.


I was going to say 'just evict them' until I read this.

What you are saying demonstrates that you do indeed understand how the Hibernate Session works. The only thing I can think of is perhaps evicting first, make changes, and then save the transient objects. It's not perfect.

-Cameron McKenzie
 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does evict behaviour cascade to child objects (one-to-many/one-to-one etc..)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic