Spring Transaction support with JDBCTemplate and Java 1.5 Annotation
Here is quick tutorial to enable transaction in a Spring project using JdbcTemplate and Java 1.5 Annotations. I'm using Spring 2.5.2, Java 1.6. (it should work with Spring 1.2 and Java 1.5 too, considering this blog post, which also gives some usefull info for people new to transaction with Spring ) for example , as simply as this : @Transactional (propagation=Propagation.REQUIRED, rollbackFor=Exception.class) public Intervention createEmptyIntervention(int idRegulation) throws Exception { //...jdbc Code } Let's begin with the beginning, applicationContext.xml : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns= "http://www.springframework.org/schema/beans" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean class=...