ravisha andar wrote:Hi All,
What is the exact advantage of using Spring transaction.
Can anybody share a sample code for implementing it
Thanks
Do you understand the purposes of a Transaction in
Java code? That is all that Spring is doing, is managing and handling a transaction for you. Starting one one, committing or rolling back for you based on success or a RuntimeException being thrown.
Code looks like this
@Transactional
public Something doWork() {
}
and definining a bean for trensactionManager and <tx:annotation-driven/>
Mark