JPA is a subset of the EJB3 standard. Tomcat does not support any EJB features, including JPA, but there are several JPA libraries that can be used in Tomcat-based webapps as WAR-supplied libraries. Probably the most popular one is Hibernate, but I've also used Apache OpenJPA.
The transaction processing capabilities of JPA are available in the Tomcat-friendly JPA implementations, but XA support for transactions spanning multiple databases (or more accurately, multiple database connections), is not provided to the best of my knowledge. The Spring Framework's transaction management may be able to provide this sort of coverage, however, possibly by linking to a true XA transaction manager. I've had my suspicions, but I've never actually needed to do anything along those lines so I don't know current capabilities.
Some DBMS's support foreign database linkages, and one would reasonably expect that any transactions done via those linkages could also be part of an enclosing transaction for the gateway DBMS.
I've done web services on Tomcat (in JPA-based
JSF webapps) using Apache's Axis and CXF facilities.
Of course, if you use enough of the advanced JEE services, neither Tomcat with added libraries nor TomEE is worth the trouble. At that point, you're better off using a full-stack server such as
WildFly, WebSphere or WebLogic.