I have read in wikipedia about the nested two phase commit (http://en.wikipedia.org/wiki/Two-phase_commit_protocol#Tree_two-phase_commit_protocol) which allows one to have a tree of two phase commits.
Is there something available in java for this and does this work with JTA implementations?
Sure, there are several transaction manager implemented in Java. If interested see for example http://narayana.io