Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] Transaction question / issue

As I am working on a BackupStore to handle touchpoint actions that deal with deleting and overwriting files I need to understand how transactions in p2 work. I have studied code, and want to get feedback on that my understanding is correct.

- A Touchpoint will receive calls to prepare(), and then to commit() or rollback() at the end of a transaction - The purpose of prepare() is to ensure that all involved resources will be commitable - A call to Touchpoint.initializePhase(... Profile, Phase...) means that the touchpoint gets involved in a transaction for the Profile for a particular phase - A touchpoint should associate any transaction state in the touchpoint properties map
- There are no concurrent transactions for a profile
- The undo methods on actions are called before the Touchpoint is told to rollback - If something goes wrong - everything should be rolled back for the profile

Questions:
- is it possible to rollback only one phase, and then continue? (I think answer is no, but want to make sure).

Most likely a bug:

EngineSession.rollback() calls Touchpoint.commit() on line 144! Shouldn't this be a call to Touchpoint.rollback? It does not matter for the current impl of NativeTouchpoint as it does nothing on commit and rollback, but the EclipseTouchpoint will commit the new configuration instead of rolling back! (it did call undo on all the actions though....)

Henrik Lindberg
henrik.lindberg@xxxxxxxxxxxxxx


Back to the top