Apache Tomcat is a lightweight alternative to a full fledged application server, if only the Servlet API, plus a few selected components of the Java EE specification will be used.
In this short tutorial I add a JTA transaction manager to Tomcat. I chose the open source version of the Atomikos transaction manager called Atomikos TransactionEssentials (Paid version: Atomikos ExtremeTransactions). Possible alternatives would be: JOTM or JBoss Transactions.
Subsequently the transaction manager is integrated in Spring and OpenJPA.
Constraint: The web application should be deployable on a full fledged application server without modification. This allows to use the extended Tomcat as the development platform, even if the application is operated on a JEE server in production.