– spring recommends a local and declarative tx approach
– programmatic (that is, “explicitly coded”) transaction management
– Global tx (eg. JTA) enable you to work with multiple transactional resources, typically relational databases and message queues
– Typically you need an application server’s JTA capability only if your application needs to handle transactions across multiple resources, which is not a requirement for many applications. Many high-end applications use a single, highly scalable database (such as Oracle RAC) instead.
– the whole no-need-multi-resources argument is part of spring’s debate against EJB arguing this is a EJB “un-realistic” requirement, e.g. oracle RAC can handle it don’t need EJB
– declarative tx removes most but not all of the need to write Java code to control transactions.
– Local transactions are resource-specific, such as a transaction associated with a JDBC connection, easier to use
– local tx application server is not involved in transaction management, it cannot help ensure correctness across multiple resources
– With the preferred declarative model, developers typically write little or no code related to transaction management, and hence do not depend on the Spring Framework transaction API, or any other transaction API