On this case as I can see in your stack trace, you were doing a XA Prepare.
Two things could happen:
I - The prepare finished on the server.. but you couldn't get a response (because of a network issue.. or anything like that).
The TM should rollback the transaction. at a later point, the TM will get a list of pending Commits, and it will be rolled back.
II - The prepare didn't arrivate on the server because (because of a network issue, or anything that didn't let you receive the message).
- The TM will just rollback the transaction and nothing else needs to be done.