Atomikos Forum |
|
Hi dear forum,
We would like to incorporate Atomikos TransactionsEssentials to our application based on: - Spring 3.0.3 - Hibernate 3.6.4 - Hibernate envers 3.6.4 - JMS - Active MQ 5.5.1 - Atomikos TransactionsEssentials (I have tried to use versions 3.7 -> 3.8) - Mysql 5.5 Global transactions are working and everything looks fine but one thing: all transactions which are chaning data which are annotated with envers annotation @Audited are rolled back. I have found some other topic on issues related with Envers but none of them helped us (see default82df.html?community.6.1621.3). Could there be missing something in our configuration? Our configuration: transactions.properties: ___________________________________ com.atomikos.icatch.service=com.atomikos.icatch.standalone.UserTransactionServiceFactory com.atomikos.icatch.serial_jta_transactions=false com.atomikos.icatch.max_actives=500 com.atomikos.icatch.enable_logging=false com.atomikos.icatch.max_timeout=3600000 com.atomikos.icatch.default_jta_timeout=1800000 com.atomikos.icatch.log_base_dir=${atomikos.transaction.manager.log_base_dir} persistence.xml ___________________________________ <persistence-unit name="application" transaction-type="JTA"> <validation-mode>AUTO</validation-mode> <properties> <property name="hibernate.transaction.manager_lookup_class" value="com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup" /> ... <property name="org.hibernate.envers.audit_table_suffix" value="${hibernate.envers.audit_table_suffix}" /> <property name="org.hibernate.envers.revision_field_name" value="${hibernate.envers.revision_field_name}" /> <property name="org.hibernate.envers.store_data_at_delete" value="true" /> </properties> </persistence-unit> spring configuration ___________________________________ <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="MysqlJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="database" value="MYSQL" /> <property name="databasePlatform" value="no.mintra.common.hibernate.dialect.CustomMySQL5InnoDBDialect" /> <!-- InnoDB dialect for tx, and fk support --> <property name="generateDdl" value="false" /> <property name="showSql" value="${repository-beans.MysqlJpaVendorAdapterParent.showSql}" /> </bean> <!-- Transaction manager configuration --> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" > <property name="forceShutdown" value="false" /> </bean> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> <property name="transactionTimeout" value="1800" /> </bean> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager" ref="atomikosTransactionManager" /> <property name="userTransaction" ref="atomikosUserTransaction" /> <qualifier value="jta" /> </bean> <bean id="MysqlDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"> <property name="xaDataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" /> <property name="uniqueResourceName" value="ourMainDatasource" /> <property name="maxPoolSize" value="${db.maxActive}" /> <property name="minPoolSize" value="${db.initialSize}" /> <property name="reapTimeout" value="300" /> <property name="testQuery" value="${db.validationQuery}" /> <property name="xaProperties"> <props> <prop key="user">${repository-beans.MySqlDataSource.username}</prop> <prop key="password">${repository-beans.MySqlDataSource.password}</prop> <prop key="url">${repository-beans.MySqlDataSource.url}</prop> <prop key="pinGlobalTxToPhysicalConnection">true</prop> </props> </property> </bean> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="MysqlDataSource" /> <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> <property name="jpaVendorAdapter" ref="MysqlJpaVendorAdapter" /> <property name="jpaProperties"> <props> <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup </prop> </props> </property> </bean> Stack trace: ___________________________________ Exception type: com.atomikos.icatch.RollbackException Root cause: The transaction was set to rollback only Stack trace: com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:254) com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:287) com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:77) com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336) com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208) com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501) com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130) org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010) org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) ______________________________________ Any ideas are welcome. Regards Marek Dominiak |