Please note: this project is inactive since early 2006
5.1 Bringing transactions to the object world
A nested EditingContext is the solution for the problem. It provides a clean and
convenient way of making changes on an other EditingContext, while exposing three of the
four ACID properties at the object level:
- Atomicity: Changes made in a nested EditingContext will be all saved in the
parent EditingContext, or none will be applied.
- Consistency: When saving the changes made in a nested EditingContext to its
parent EditingContext, these changes will be checked just as when you save changes on
an EditingContext to the database: there is no way to save an inconsistent state.
- Isolation: All changes made to a nested EditingContext are kept private within
the nested EditingContextuntil they are saved to the parent EditingContext. Until this point,
even the parent will not be aware of the changes.
In other words, you can think of a nested EditingContext as a transaction
made at the object level.
Moreover, any object you will get
in a nested EditingContextwill reflect the changes made on it in its parent, even
the uncommitted/unsaved ones, e.g. inserted objects will show up in the
result set of a fetch, but deleted objects won't.
Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted by: