Announcement Announcement Module
Collapse
No announcement yet.
help transacction fail Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • help transacction fail

    This is the problem :
    ROLLBACK doesn't take place in the database. The registration edition is inserted when he/she should not make it however any error log it doesn't exist. Do these transactions of Spring really work?, Please help me

    Edition Manager :

    private EditionDAO editionDAO;

    public void setEditionDAO(EditionDAO editionDAO) throws KedrosDAOException {
    this.editionDAO = (EditionDAO) DAOFactory.getBeanFactory("EditionDAO");
    }

    public EditionDAO getEditionDAO() {
    return editionDAO;
    }






    public void insertEdition(EditionVO vo) throws Exception {

    GroupEditionVO groupEditionVO = new GroupEditionVO(new Integer(lastID.generateId("GROUP_EDITION")),
    vo.getEditionName(), vo.getEditionId());
    GetLastID lastID = (GetLastID)DAOFactory.getBeanFactory("GetLastID");


    getEditionDAO().insertEdition(vo);

    int i=10/0;

    groupEditionDAO.insertGroupEdition(groupEditionVO) ;

    }



    The configuration of the transaction :

    <bean id="transactionTemplate2" abstract="true"
    class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="transactionManager" />
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>




    The log

    [23 jul 2007 15:06:34] RuleBasedTransactionAttribute (DEBUG) - Applying rules to determine whether transaction should rollback on java.lang.ArithmeticException: / by zero
    [23 jul 2007 15:06:34] RuleBasedTransactionAttribute (DEBUG) - Winning rollback rule is: null
    [23 jul 2007 15:06:34] RuleBasedTransactionAttribute (DEBUG) - No relevant rollback rule found: applying superclass default
    [23 jul 2007 15:06:34] TransactionInterceptor (DEBUG) - Invoking rollback for transaction on es.satec.kedros.datos.manager.EditionManager.inser tEdition due to throwable [java.lang.ArithmeticException: / by zero]
    [23 jul 2007 15:06:34] DataSourceTransactionManager (DEBUG) - Triggering beforeCompletion synchronization
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@1d592a] for key [org.springframework.jdbc.datasource.TransactionAwa reDataSourceProxy@24c672] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@19299f5] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@6078e7] bound to thread [main]
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@d37b87] for key [org.springframework.jdbc.datasource.TransactionAwa reDataSourceProxy@13b625b] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@71949b] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@1b67d6a] bound to thread [main]
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@75c744] for key [org.springframework.jdbc.datasource.TransactionAwa reDataSourceProxy@fbf51d] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@f62eba] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@19977bd] bound to thread [main]
    [23 jul 2007 15:06:34] DataSourceTransactionManager (DEBUG) - Initiating transaction rollback
    [23 jul 2007 15:06:34] DataSourceTransactionManager (DEBUG) - Rolling back JDBC transaction on Connection [com.mysql.jdbc.Connection@117c0eb]
    [23 jul 2007 15:06:34] DataSourceTransactionManager (DEBUG) - Triggering afterCompletion synchronization
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@19299f5] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@6078e7] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@71949b] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@1b67d6a] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@f62eba] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@19977bd] from thread [main]
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Clearing transaction synchronization
    [23 jul 2007 15:06:34] TransactionSynchronizationManager (DEBUG) - Removed value [org.springframework.jdbc.datasource.ConnectionHold er@15d4273] for key [org.springframework.jdbc.datasource.DriverManagerD ataSource@1486306] from thread [main]
    [23 jul 2007 15:06:34] DataSourceTransactionManager (DEBUG) - Releasing JDBC Connection [com.mysql.jdbc.Connection@117c0eb] after transaction
    [23 jul 2007 15:06:34] DataSourceUtils (DEBUG) - Returning JDBC Connection to DataSource

    Last edited by amarques; Jul 23rd, 2007, 10:14 AM.
Working...
X