Transaction Management

The tomcat connection pooled datasource is registered with spring managed transaction manager in persistence_postgres.xml

<tx:annotation-driven transaction-manager="openSRPTransactionManager" />

<bean id="openSRPTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">

    <property name="dataSource" ref="openSRPDataSource" />

</bean>

Spring transaction management can be used to define transactions

To define a method or class as having a transaction or part of a transaction simply annotate the method with @Transactional annotation.

Use the documentation on https://docs.spring.io/spring/docs/3.1.x/spring-framework-reference/html/transaction.html to learn more about spring managed transactions