Announcement Announcement Module
Collapse
No announcement yet.
After commiting the transaction data not getting updated in database even no error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • After commiting the transaction data not getting updated in database even no error

    Hi All,
    We're using DataSourceTransactionManager for implementing transaction management in our Spring-MVC 2.5 application.
    Its been felt that at few times even after committing the transaction explicitly through the code, the transaction is not getting committed (But not throwing any exception).
    Following is the snipped of code (how we are committing the transaction) :-

    xml file
    --------------------------------------
    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="jdbc/DBNAME"/>
    </bean>

    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
    </bean>

    <bean id="JdbcDao" abstract="true" class="org.springframework.jdbc.core.support.Simpl eJdbcDaoSupport">
    <property name="dataSource" ref="dataSource"/>
    </bean>

    controller----------------------
    <bean id="abcController" class="com.ControllerClass">
    <property name="sessionForm" value="false"/>
    <property name="commandName" value="abcController"/>
    <property name="commandClass" value="com.CommandClass"/>
    <property name="formView" value="OutFile"/>
    <property name="successView" value="ResultFile"/>
    <property name="abcServices" ref="abcServices"/>
    </bean>

    services-------------------------
    <bean id="abcServices" class="com.ServiceClass">
    <property name="abcDao" ref="abcDao"/>
    <property name="pm" ref="txManager"/>
    </bean>

    Dao------------------------------
    <bean id="abcDao" class="com.DaoClass" parent="JdbcDao">
    <property name="CalculationService" ref="CalculationService"/>
    </bean>

    <bean id="CalculationService" class="com.CalculationService" parent="JdbcDao" />
    ---------------------------------------
    Controller class has following code for trnsaction management:-

    TransactionDefinition def = new DefaultTransactionDefinition(TransactionDefinition .PROPAGATION_REQUIRED);

    TransactionStatus status = this.pm.getTransaction(def);

    <//lot of code goes in here, then;>
    this.pm.commit(status);

    Can anybody plz help in putting light on as to why some of the times transaction is not getting committed, while it is getting committed some times.
    Thanks in advance
Working...
X