[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: [CDO] CDOSavePoint and rollback question

Hello Kai,
Yes, that is what I meant. I am designing my app at the moment for single user, but keep a multi user setup in the back of my mind.
CDO makes this very easy, but it also has many advantages for single user applications.
I use the rollback for example to undo all changes of a bigger model that is modified by a large wizard dialog when the cancel button is pressed.
I exercised a small example with a CDO model, a view that displays model data and a wizard that adds or modifies data. As you certainly do, my wizard creates a CDOSavePoint hen it is initialized. When the wizard is canceled, the transaction is rolled back to the savepoint. When the wizard performs finish, the transaction is committed. As wizard modifications of the model would trigger UI updates in the view, I open a separate transaction from where I retrieve model objects that are passed to the wizard. All modifications are isolated until the wizard commits the transaction. After the wizard dialog is closed, the wizard transaction is closed, regardless of the dialog's return code.

My application used CDO with a JVMConnector and MemStore. Committing a transaction does not mean that the document is actually saved. In applications where commit is equivalent to saving the document, above approach would not be appropriate. A real nested, isolated transaction would be fine for that, but I don't think CDO will support that.

Kind regards, Sebastian