aspose file tools*
The moose likes Spring and the fly likes Spring Transaction Support Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Transaction Support" Watch "Spring Transaction Support" New topic
Author

Spring Transaction Support

Cheung Chau
Greenhorn

Joined: May 25, 2009
Posts: 15
Hi everyone,

I believe Spring framework support more than just database tranaction. However, it is hard to find an example not including database transaction. Can anyone here give me a pointer on how to find such a tutorial. Thank you

-CCC
Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
You might start here:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/transaction.html#transaction-application-server-integration

The basic idea behind Spring Transaction support is to offer consistency in how you apply transactional behavior to your apps. That means you basically configure the appropriate transaction manager (or look it up using JNDI). Once configured, the @Transactional annotation should work the same.

If you are talking about invoking XA type behavior, I don't know of any examples specifically for that. However, also check out:
http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html

Cheung Chau
Greenhorn

Joined: May 25, 2009
Posts: 15
Hi Mark,

Thank you for your reply. Believe it or not I give up searching two sections before that section (10.8) - around section 10.5 and 10.6, where I draw the conclusion that all the solid example will be about database. I also read 'Spring in Action' 3rd ed chapter 6 once - there is no complete example. You actually almost summarized the chapter with your comment

I am looking for and end-to-end tutorial - something that start with POJO class and end with a main class or JUnit test case that execute action in the POJO class or rollback if error. I know that may not exist or require me learning spec like JTA or technology like JBoss AS.

But can you give me some more pointer where to start. Anyway, thank you so much for your time.

-CCC
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

But the point is, it doesn't matter. Databases or not, JTA or not, JBoss App Server or not, the way you do Transactions in Spring is always the same.

declare a transaction manager, then annotated your methods or class with @Transactional that you want to be transactional.

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 Support