It's not a secret anymore!
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
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Transaction Support" Watch "Spring Transaction Support" New topic

Spring Transaction Support

Cheung Chau

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

Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
You might start here:

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:

Cheung Chau

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.

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Spring Transaction Support
It's not a secret anymore!