Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making specific method non transactional in Spring

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers
I have a spring application which is based on Spring Batch. By default spring batch introduces transaction for its steps. There are certain stages where I don't really need transaction to be enabled. Because transaction is enabled unnecessary for these methods its giving me some runtime errors as I am making call to two different databases in one method.

Is there any annotation which spring provides to DISABLE transaction for a specific set of methods ?

I am even open to the solution which can disable transaction globally.
Any link , paper will greatly be appreciated.
Thanks in advance
Samir


 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a nutshell I want to call some method which does not need to be transactional from a transactional method.

Is there any way I can do it ?

Thanks
Samir
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have a look at the propation types. In particual NOT_SUPPORTED

http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/transaction/annotation/Propagation.html#NOT_SUPPORTED

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic