spring配置
<context:component-scan base-package="net.noday" />
<aop:aspectj-autoproxy />
<tx:annotation-driven transaction-manager="txManager" />

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.gjt.mm.mysql.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/noday?useUnicode=true&amp;characterEncoding=UTF-8" />
<property name="username" value="root" />
<property name="password" value="" />
<property name="initialSize" value="1" />
<property name="maxActive" value="50" />
<property name="maxIdle" value="2" />
<property name="minIdle" value="1" />
</bean>

<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
service@Service
@Transactional(readOnly=true)
public class PersonService implements IPersonService { @Autowired
private PersonDAO personDAO;

@Override
@Transactional(readOnly=false, propagation=Propagation.REQUIRES_NEW)
public void delete(Integer id) {
personDAO.delete(id);
throw new RuntimeException("dd");
}
//其他方法
}dao代码@Repository("personDAO")
public class PersonDAO { @Autowired
private JdbcTemplate jdbcTemplate;

public void add(Person person) {
jdbcTemplate.update("insert into person(name) values(?)", 
new Object[]{person.getName()}, new int[]{java.sql.Types.VARCHAR});
}

public void update(Person person) {
jdbcTemplate.update("update person set name=? where id=?", 
new Object[]{person.getName(),person.getId()}, 
new int[]{java.sql.Types.VARCHAR, java.sql.Types.INTEGER});
}

public Person get(Integer id) {
return (Person)jdbcTemplate.queryForObject("select * from person where id=?", 
new Object[]{id}, 
new PersonRowMapper());
}

public List<Person> getAll() {
return (List<Person>)jdbcTemplate.query("select * from person", 
new PersonRowMapper());
}

public void delete(Integer id) {
jdbcTemplate.update("delete from person where id=?", 
new Object[]{id}, 
new int[]{java.sql.Types.INTEGER});
}
}test @BeforeClass
public static void  setUpBeforeClass() throws Exception {
try {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
personService = (IPersonService) ctx.getBean("personService");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void delete() {
personService.delete(17);
}
测试删除事物无效,求解