you need a transaction manager to handel two face commit.there are several transaction managers such as JOTM (which is an open source transaction manager).however some of application servers contain transaction manager,such as IBM websphere,JBoss and so on.