aspose file tools*
The moose likes Spring and the fly likes Spring transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring transaction" Watch "Spring transaction" New topic
Author

Spring transaction

ravisha andar
Ranch Hand

Joined: Feb 25, 2011
Posts: 55
Hi All,

What is the exact advantage of using Spring transaction.

Can anybody share a sample code for implementing it

Thanks
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring transaction
 
Similar Threads
Spring Transaction Management
What is "Lightweight"?
EJB 3 Vs Spring 2.5
hibernate in Spring framework
Hibernate and transaction management