This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Set the transcation boundry in DO using spring jdbc framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Reply locked New topic

Set the transcation boundry in DO using spring jdbc framework

Roopali Gaikwad

Joined: Mar 05, 2009
Posts: 4
we are using spring jdbc framework in our project.

Right now we have kept the transcation boundry at the service level which the entry point from client side to sever side.
We have applicationContext.xml file where we have defined the transcation boundry condition for each service.

here is piece of code of applicationContext.xml
<tx:advice id="txAdvice" transaction-manager="txManager">
<!-- the transactional semantics... -->
all methods starting with 'select' or 'get' are read-only
all methods that start with save require a new transaction
<tx:method name="select*" read-only="true" />
<tx:method name="get*" read-only="true"/>
<tx:method name="save*" propagation="REQUIRES_NEW" />
<tx:method name="insert*" read-only="false" propagation="REQUIRES_NEW" />
<tx:method name="update*" propagation="REQUIRES_NEW" />
<tx:method name="import*" propagation="REQUIRES_NEW" />
<!-- other methods use the default transaction settings (see below) -->
<tx:method name="*"/>

<!-- @1. Ensure that the above transactional advice runs for any execution
of an operation defined by the service interfaces.
@2. Defines Transaction Manager Boundaries.
<aop:pointcut id="usersServiceOperation" expression="execution(**(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="usersServiceOperation" />

But in one case the entry point is one sevlet from where we call the sevice method and and from service we call a method from domain object
In this case the transcation boundry is not getting applied.
and if i want to set the transaction boundry in DO level how can i do this?

Please help.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Why is this a word-for-word copy of the post right before this? Closing this one.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Set the transcation boundry in DO using spring jdbc framework
It's not a secret anymore!