Announcement Announcement Module
Collapse
No announcement yet.
Transaction pb Hibernate/MySQL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transaction pb Hibernate/MySQL

    Hi, I have a problem with transaction under Spring/Hibernate/MySQL.

    I use transcation (declaratives) to manage a object insertion, this object have a many-to-one relation with another (cascade is all).

    First take a look to my spring context :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    	  
    <beans> 
      
      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName">
          <value>com.mysql.jdbc.Driver</value>
        </property>
        <property name="url">
          <value>jdbc&#58;mysql&#58;//localhost/euroflash</value>
        </property>
        <property name="username">
          <value>root</value>
        </property>
        <property name="password">
          <value></value>
        </property>
      </bean>
    
       <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
           <property name="mappingResources">
               <list>
                   <value>com/euroflash/gestion/business/Adresse.hbm.xml</value>
                   <value>com/euroflash/gestion/business/Personne.hbm.xml</value>
               </list> 
           </property>
           <property name="hibernateProperties">
               <props>
                   <prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
               </props>
           </property>
           <property name="dataSource">
               <ref bean="dataSource"/>
           </property>
       </bean>
       
       <bean id="transactionManager" 
            class="org.springframework.orm.hibernate.HibernateTransactionManager">
            <property name="sessionFactory">
                <ref bean="sessionFactory"/>
            </property>
       </bean>
       
       <bean id="exceptionManager" 
            class="com.euroflash.gestion.manager.ManagerExceptionHandler">
       </bean>
       
       <bean id="personneDao" class="com.euroflash.gestion.dao.impl.hbm.PersonneDaoImpl">
            <property name="sessionFactory">
                <ref bean="sessionFactory"/>
            </property>
       </bean>
       
       <bean id="personneManagerTarget" class="com.euroflash.gestion.manager.impl.hbm.PersonneManagerImpl">
            <property name="personneDao">
                <ref bean="personneDao"/>
            </property>
       </bean>
       
       <bean id="personneManagerHbm" 
            class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager">
                <ref bean="transactionManager"/>
            </property>
            <property name="target">
                <ref bean="personneManagerTarget"/>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="*">PROPAGATION_REQUIRED</prop>
                </props>
            </property>
        </bean>
        
       <bean id="personneManager" class="org.springframework.aop.framework.ProxyFactoryBean"> 
    	   	<property name="proxyInterfaces">
    	   		<value>com.euroflash.gestion.manager.PersonneManager</value>
    	   	</property>
    	   	<property name="target">
    	   		<ref local="personneManagerHbm"/>
    	   	</property>
    	   	<property name="interceptorNames"> 
    	   		<list>
    	   			<value>exceptionManager</value>
    	   		</list>
    	   	</property> 
       	</bean> 
       
    
    </beans>

    There is a many-to-one with cascade all between Personne - Adresse described like this :

    Code:
        /**
         * @hibernate.many-to-one class="com.euroflash.gestion.business.Adresse"
         * 	foreign-key="PersonneAdresse"
         *  property-ref="id"
         *  constrained="true"
         *  column="idAdresse"
         *  cascade="all"
         * @return Returns the adresse.
         */
        public Adresse getAdresse&#40;&#41; &#123;
            return adresse;
        &#125;
    And here my PersonneDao code for save method :

    Code:
        public final void save&#40;Object object&#41; &#123;
            getHibernateTemplate&#40;&#41;.save&#40;object&#41;;
    
        &#125;
    My manager code :

    Code:
    	public void save&#40;Personne personne&#41; throws ManagerException &#123;
    			personneDao.save&#40;personne&#41;;
    	&#125;
    Now, when I try to save a personne with an asscocied adresse, I have a problem. I launch test in debug mode (step by step), Here the explanation :

    manager.save() :

    Code:
    2004-08-28 15&#58;47&#58;41,615 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Getting transaction for method 'save' in class &#91;com.euroflash.gestion.manager.PersonneManager&#93;
    2004-08-28 15&#58;47&#58;41,683 INFO &#91;org.springframework.jdbc.datasource.DataSourceTransactionObject&#93; - JDBC 3.0 Savepoint class is available
    2004-08-28 15&#58;47&#58;41,686 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Using transaction object &#91;[email protected]a&#93;
    2004-08-28 15&#58;47&#58;41,689 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Creating new transaction
    2004-08-28 15&#58;47&#58;41,691 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Opening Hibernate session
    2004-08-28 15&#58;47&#58;42,796 DEBUG &#91;net.sf.hibernate.impl.SessionImpl&#93; - opened session
    2004-08-28 15&#58;47&#58;42,811 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Opened new session &#91;net.sf.hibernate.impl.SessionImpl@38202&#93; for Hibernate transaction
    2004-08-28 15&#58;47&#58;42,941 DEBUG &#91;net.sf.hibernate.transaction.JDBCTransaction&#93; - begin
    2004-08-28 15&#58;47&#58;42,950 DEBUG &#91;net.sf.hibernate.transaction.JDBCTransaction&#93; - current autocommit status&#58;true
    2004-08-28 15&#58;47&#58;42,960 DEBUG &#91;net.sf.hibernate.transaction.JDBCTransaction&#93; - disabling autocommit
    2004-08-28 15&#58;47&#58;43,030 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Exposing Hibernate transaction as JDBC transaction &#91;org.apache.commons.dbcp.PoolableConnection@8c10af&#93;
    2004-08-28 15&#58;47&#58;43,090 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@9b5b2f&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@6f5ae2&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;47&#58;43,100 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.orm.hibernate.SessionHolder@cdd17f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@7f9401&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;47&#58;43,110 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Initializing transaction synchronization
    dao.save()

    Code:
    2004-08-28 15&#58;04&#58;34,571 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@d36efb&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;04&#58;35,480 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@d36efb&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    At this step, if I check my data in database, I have one line in adresse and one line in personne, but the transaction was not committed ! So Hivernate insert the adresse and afer the personne, but if personne insertion crash, the adresse is in database and was not deleted during rollbak. I can't find where the problem came from MySQL config, Hivernate config or Spring config ??

    I hope somebody can help me

    BTW: Here the next log :

    Code:
    2004-08-28 15&#58;05&#58;17,764 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Invoking commit for transaction on method 'save' in class &#91;com.euroflash.gestion.manager.PersonneManager&#93;
    2004-08-28 15&#58;05&#58;17,766 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCommit synchronization
    2004-08-28 15&#58;05&#58;17,769 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCompletion synchronization
    2004-08-28 15&#58;05&#58;17,770 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Initiating transaction commit
    2004-08-28 15&#58;05&#58;17,770 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Committing Hibernate transaction on session &#91;net.sf.hibernate.impl.SessionImpl@b5e07a&#93;
    2004-08-28 15&#58;05&#58;17,785 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering afterCompletion synchronization
    2004-08-28 15&#58;05&#58;17,817 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Clearing transaction synchronization
    2004-08-28 15&#58;05&#58;17,818 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.orm.hibernate.SessionHolder@d36efb&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;17,819 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.jdbc.datasource.ConnectionHolder@39f0bb&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;17,820 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Closing Hibernate session &#91;net.sf.hibernate.impl.SessionImpl@b5e07a&#93; after transaction
    2004-08-28 15&#58;05&#58;17,820 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Closing Hibernate session
    2004-08-28 15&#58;05&#58;18,163 INFO &#91;com.euroflash.gestion.manager.ManagerExceptionHandler&#93; - Execution de save&#40;&#123;com.euroflash.gestion.business.Contact@a58701&#91;dernierContact=Sat Aug 28 15&#58;03&#58;36 CEST 2004,prenom=Renaud,nom=Brault,adresse=com.euroflash.gestion.business.Adresse@660e34&#91;adresse=19 rue de l'armorique,codePostal=75015,ville=Paris,telephone=<null>,portable=0622152439,fax=<null>,id=31&#93;,email=[email protected],id=11&#93;&#125;&#41; return null in 101842 msec.
    2004-08-28 15&#58;05&#58;18,164 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Getting transaction for method 'findById' in class &#91;com.euroflash.gestion.manager.AdresseManager&#93;
    2004-08-28 15&#58;05&#58;18,165 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Using transaction object &#91;[email protected]0&#93;
    2004-08-28 15&#58;05&#58;18,165 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Creating new transaction
    2004-08-28 15&#58;05&#58;18,165 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Opening Hibernate session
    2004-08-28 15&#58;05&#58;18,171 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Opened new session &#91;net.sf.hibernate.impl.SessionImpl@ea6c92&#93; for Hibernate transaction
    2004-08-28 15&#58;05&#58;18,173 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Exposing Hibernate transaction as JDBC transaction &#91;org.apache.commons.dbcp.PoolableConnection@1383eb&#93;
    2004-08-28 15&#58;05&#58;18,174 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@7dffde&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;18,174 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.orm.hibernate.SessionHolder@297ad9&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;18,174 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Initializing transaction synchronization
    2004-08-28 15&#58;05&#58;18,201 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@297ad9&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;18,350 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@297ad9&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;18,952 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@297ad9&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;18,958 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Invoking commit for transaction on method 'findById' in class &#91;com.euroflash.gestion.manager.AdresseManager&#93;
    2004-08-28 15&#58;05&#58;18,963 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCommit synchronization
    2004-08-28 15&#58;05&#58;18,968 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCompletion synchronization
    2004-08-28 15&#58;05&#58;18,973 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Initiating transaction commit
    2004-08-28 15&#58;05&#58;18,979 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Committing Hibernate transaction on session &#91;net.sf.hibernate.impl.SessionImpl@ea6c92&#93;
    2004-08-28 15&#58;05&#58;18,987 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering afterCompletion synchronization
    2004-08-28 15&#58;05&#58;18,992 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Clearing transaction synchronization
    2004-08-28 15&#58;05&#58;18,996 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.orm.hibernate.SessionHolder@297ad9&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,002 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.jdbc.datasource.ConnectionHolder@7dffde&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,007 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Closing Hibernate session &#91;net.sf.hibernate.impl.SessionImpl@ea6c92&#93; after transaction
    2004-08-28 15&#58;05&#58;19,013 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Closing Hibernate session
    2004-08-28 15&#58;05&#58;19,021 INFO &#91;com.euroflash.gestion.manager.ManagerExceptionHandler&#93; - Execution de findById&#40;&#123;31&#125;&#41; return com.euroflash.gestion.business.Adresse@4f23ae&#91;adresse=19 rue de l'armorique,codePostal=75015,ville=Paris,telephone=<null>,portable=0622152439,fax=<null>,id=31&#93; in 857 msec.
    2004-08-28 15&#58;05&#58;19,087 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Getting transaction for method 'findById' in class &#91;com.euroflash.gestion.manager.PersonneManager&#93;
    2004-08-28 15&#58;05&#58;19,088 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Using transaction object &#91;[email protected]a1&#93;
    2004-08-28 15&#58;05&#58;19,089 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Creating new transaction
    2004-08-28 15&#58;05&#58;19,089 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Opening Hibernate session
    2004-08-28 15&#58;05&#58;19,090 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Opened new session &#91;net.sf.hibernate.impl.SessionImpl@1a7296&#93; for Hibernate transaction
    2004-08-28 15&#58;05&#58;19,125 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Exposing Hibernate transaction as JDBC transaction &#91;org.apache.commons.dbcp.PoolableConnection@1383eb&#93;
    2004-08-28 15&#58;05&#58;19,126 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@58ff73&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,126 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.orm.hibernate.SessionHolder@eae719&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,126 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Initializing transaction synchronization
    2004-08-28 15&#58;05&#58;19,127 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@eae719&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,128 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@eae719&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,183 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@eae719&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; bound to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,184 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Invoking commit for transaction on method 'findById' in class &#91;com.euroflash.gestion.manager.PersonneManager&#93;
    2004-08-28 15&#58;05&#58;19,184 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCommit synchronization
    2004-08-28 15&#58;05&#58;19,184 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering beforeCompletion synchronization
    2004-08-28 15&#58;05&#58;19,184 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Initiating transaction commit
    2004-08-28 15&#58;05&#58;19,185 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Committing Hibernate transaction on session &#91;net.sf.hibernate.impl.SessionImpl@1a7296&#93;
    2004-08-28 15&#58;05&#58;19,187 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Triggering afterCompletion synchronization
    2004-08-28 15&#58;05&#58;19,187 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Clearing transaction synchronization
    2004-08-28 15&#58;05&#58;19,189 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.orm.hibernate.SessionHolder@eae719&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,190 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Removed value &#91;org.springframework.jdbc.datasource.ConnectionHolder@58ff73&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; from thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,191 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Closing Hibernate session &#91;net.sf.hibernate.impl.SessionImpl@1a7296&#93; after transaction
    2004-08-28 15&#58;05&#58;19,191 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Closing Hibernate session
    2004-08-28 15&#58;05&#58;19,289 INFO &#91;com.euroflash.gestion.manager.ManagerExceptionHandler&#93; - Execution de findById&#40;&#123;11&#125;&#41; return com.euroflash.gestion.business.Conta....business.Adresse@7e0f6&#91;adresse=19 rue de l'armorique,codePostal=75015,ville=Paris,telephone=<null>,portable=0622152439,fax=<null>,id=31&#93;,email=[email protected],id=11&#93; in 203 msec.
    2004-08-28 15&#58;05&#58;19,290 DEBUG &#91;org.springframework.transaction.interceptor.TransactionInterceptor&#93; - Getting transaction for method 'save' in class &#91;com.euroflash.gestion.manager.PersonneManager&#93;
    2004-08-28 15&#58;05&#58;19,290 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Using transaction object &#91;[email protected]2e&#93;
    2004-08-28 15&#58;05&#58;19,290 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Creating new transaction
    2004-08-28 15&#58;05&#58;19,291 DEBUG &#91;org.springframework.orm.hibernate.SessionFactoryUtils&#93; - Opening Hibernate session
    2004-08-28 15&#58;05&#58;19,291 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Opened new session &#91;net.sf.hibernate.impl.SessionImpl@ee0563&#93; for Hibernate transaction
    2004-08-28 15&#58;05&#58;19,294 DEBUG &#91;org.springframework.orm.hibernate.HibernateTransactionManager&#93; - Exposing Hibernate transaction as JDBC transaction &#91;org.apache.commons.dbcp.PoolableConnection@1383eb&#93;
    2004-08-28 15&#58;05&#58;19,294 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@a3e311&#93; for key &#91;org.apache.commons.dbcp.BasicDataSource@e9fb74&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,295 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Bound value &#91;org.springframework.orm.hibernate.SessionHolder@90a11e&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@ebc11d&#93; to thread &#91;main&#93;
    2004-08-28 15&#58;05&#58;19,295 DEBUG &#91;org.springframework.transaction.support.TransactionSynchronizationManager&#93; - Initializing transaction synchronization

  • #2
    is this the same issue as Transaction question about HibernateTransactionManager

    what version of mysql are you using? does your usecase works when you use hibernate without spring?
    Last edited by Rod Johnson; Jan 18th, 2006, 11:22 AM.

    Comment


    • #3
      Your log doesn't show any rollback, first of all. When, how does that happen? Are you doing it manually just for testing?

      Are you actually looking in the db after your rollback, or are you looking at your Java objects. When you rollback, your java objects will not be touched; that is, if you had set an address on the person, then tried to commit changes, and had a rollback, the person will still have an address. The db should be clear though...

      Comment

      Working...
      X