You can buy this project and download/modify it how often you want.
Contains structures for 2 phase commit functionality.