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.
|