File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Making specific method non transactional in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Making specific method non transactional in Spring" Watch "Making specific method non transactional in Spring" New topic
Author

Making specific method non transactional in Spring

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
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

Joined: Jul 27, 2005
Posts: 192
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

Joined: Mar 07, 2010
Posts: 1648
    
    7

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



[How To Ask Questions][Read before you PM me]
 
 
subject: Making specific method non transactional in Spring