Spring JDBC Template with business level transaction management

159 Views Asked by At

I want to handle and rollback exceptions inside business service level, but when i use datasourcetransacitonmanager inside jdbctemplete it is just handle, database exceptions, do you have any suggestions? multiple management or ? merge the transaction managers?

1

There are 1 best solutions below

1
On

Check out @Transactional annotation on the service method. That should make anything within the service transactional to where if one fails it all rolls back.

http://docs.spring.io/spring-framework/docs/2.5.x/api/org/springframework/transaction/annotation/Transactional.html