Implementation of Two Phase Commit