What type of transaction management strategy we should use in Spring? Declarative or Programmatic? Which one is better and under what situation one should use it? Can you give a
Spring offers both programmatic and declarative transactions.
Programmatic means you have transaction management code surrounding your business code. This gives extreme flexibility, but is difficult to maintain and, well, boilerplate.
Declarative means you separate transaction management from the business code. You can use annotations or XML based configuration.
programmatic management is more flexible during development time but less flexible during application life
declarative management is less flexible during development time but more flexible during application life
http://docs.spring.io/spring/docs/3.0.x/reference/transaction.html
Declarative Transaction Management allows to eliminate any dependencies on the transaction framework from the Java code. The four participants to provide the transaction support are transaction manager, proxy factory, transaction interceptor, and a set of transaction attributes.
Suggest to use Declarative Transaction Management, Alternative for HibernateTemplates either NamedJDBCTemplate or simpleJDBCTemplate