-->
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: Rollback object state
PostPosted: Fri Sep 02, 2005 5:54 am 
Can I rollback object state with nHibernate transaction

i have object A that have collection of objects B, each of them have collection of objects C

scenario 1.- Existing A ,
- add new B object,
- add new C object to the B object
- Rollback

result:A have full ierarchy of objects A->B->C not rolled back. ( but in DB nothing present. )
workaround:
Session.Refresh( A ) help in this case.


scenario 2.- Existing A ,
- Existing B ,
- Add new C to B
- RollBack

result:
as in scenario 1.
workaround:
Session.Refresh( A ) DOES NOT help in this case. it refresh only A level
and not refresh B. need refresh all B objects separately


in Big Hiearhy of object it is hard. need method that can recursive refresh objects.


Top
  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 7:17 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Transaction.Rollback() doesn't affect your entities; it is related to the Database operations you made.

What you can do to get your entities as they were, is to load them again (NHibernate will use its caches to create them...)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.