MulleEODatabaseStore

From EOFWiki
Jump to: navigation, search

Contents

Transactional Interface

During saveChanges the EODatabaseContext will be called to perform prepareChanges and then recordChangesInEditingContext and finally peformChanges. If peformChanges succeeds commitChanges will be called and if it fails rollbackChanges is called.

It is important to note, that during the first stage from prepareChanges to the end of performChanges no state inside the EODatabaseContext or the EOEditingContexts is affected, except that an array of EODatabaseOperations is build up. In case of a commitChanges these EODatabaseOperations are then converted into snapshots and invalidation of EOEditingContext objects takes place.

In case of a rollback these EODatabaseOperations are discarded and everything is as it was before.

MulleEOF Addition exposed Transactional Interface

In newer MulleEOF versions, the actual transactional interface of the SQL database, that is usually hidden by the performChanges and commitChanges/rollbackChanges is exposed with beginTransaction, commitTransaction and rollbackTransaction. If the EODatabaseContext gets called with beginTransaction before prepareChanges, it will not perform transational commands with the database itself. The promotion of the EODatabaseOperations is suspended until the adaptor notifies that a commit has taken place. This can be useful in a scenario like this, when you want to mix EOAdaptor level operations and EOEditingContext generated SQL in one transaction.


Contents

MulleEODatabaseStore Additions

Dependencies

Personal tools