Is there a way to only rollback a subset of changes or to a certain state? Let’s assume we have a dialog to make a new customer. In this dialog we have buttons to open further dialogs to attach other objects to this new customer. One such object would be his address. I'm only saving the customer and his address when the user pushes "save" but not if "cancel". The problem is that the user can do that with the address too.
So a user makes a customer "Miller" with the address in "Boston" presses "OK" in the address sub dialog and lands back in the customer dialog where he changes the Name to "Smith", presses "edit" on the address again and changes that from "Boston" to "New York" and hits "cancel". Back in the customer Dialog he presses "save" and in the DB "Smith" and "Boston" is saved.
How can I do that without handling this partial rollback by hand?