Announcement Announcement Module
Collapse
No announcement yet.
Transaction does not rollback when calling service method... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transaction does not rollback when calling service method...

    public class MyService {
    public void save() {
    save2();
    }

    public void save2() {
    getDAO.insert1();
    getDAO.insert2();
    }
    }



    public class MyAction {

    public ActionForward execute(...) {

    myService.save();

    }
    }


    when transaction is declared on "save()" method, transaction does rollback, but transaction does not rollback when "save2()" is declared
    "PROGATION_REQUIRED"...unless the action class also called save2()...

    myService.save2()

    please explain this behavior, thank you



    <bean id="myService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager"><ref local="transactionManager"/></property>
    <property name="target"><ref local="myTarget"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="save2">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>

  • #2
    Please take a look at this thread: Transaction Behaviour.
    HTH
    Last edited by robyn; May 19th, 2006, 05:54 AM.

    Comment

    Working...
    X