An example implementation of 2 Phase Commit