• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Spring Transaction Support

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
    Bookmark Topic Watch Topic
  • New Topic