在对应方法上加上@Transactional注解如
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, rollbackFor = { Throwable.class,
Exception.class, RuntimeException.class })
public void testFunc(){
... ...
}
关于注解@Transactional 见 http://www.cnblogs.com/guxia/p/6431848.html