问题描述
以前一直用weblogic,现在要把程序的目标AP变成WEBSPHERE,我在SPRING配置中的transaction配置如下<beanid="wsJM"class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean"/><!--TransactionManagers--><beanid="transactionManager"class="org.springframework.transaction.jta.JtaTransactionManager"scope="singleton"><propertyname="transactionManager"ref="wsJM"/></bean><!--TransactionConfiguration--><tx:adviceid="txAdvice"transaction-manager="transactionManager"><tx:attributes><tx:methodname="create*"propagation="REQUIRED"isolation="READ_COMMITTED"timeout="300"rollback-for="Throwable"/><tx:methodname="update*"propagation="REQUIRED"isolation="READ_COMMITTED"timeout="300"rollback-for="Throwable"/><tx:methodname="delete*"propagation="REQUIRED"isolation="READ_COMMITTED"timeout="300"rollback-for="Throwable"/><tx:methodname="run*"propagation="REQUIRED"isolation="READ_COMMITTED"timeout="300"rollback-for="Throwable"/><tx:methodname="find*"propagation="SUPPORTS"isolation="READ_COMMITTED"read-only="true"timeout="300"rollback-for="Throwable"/><tx:methodname="is*"propagation="SUPPORTS"isolation="READ_COMMITTED"read-only="true"timeout="300"rollback-for="Throwable"/><tx:methodname="count*"propagation="SUPPORTS"isolation="READ_COMMITTED"read-only="true"timeout="300"rollback-for="Throwable"/></tx:attributes></tx:advice><!--Autoproxying--><beanid="ServiceAutoProxyBeanCreator"class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"><propertyname="beanNames"><list><value>*Service</value></list></property><propertyname="interceptorNames"><list><value>txAdvice</value></list></property></bean>这种配置,我在使用时候,执行create一些方法时候,系统会报错,说JtaTransactionManagerdoesnotsupportcustomisolationlevelsbydefault-switch'allowCustomIsolationLevels'to'true'我按他建议的,把'allowCustomIsolationLevels'设置成true,运行时可以,但是我试验过transaction一个方法里面,插入数据后,我故意抛出异常,数据并没有被回滚请问这个问题怎么解决?
解决方案
解决方案二:
关注,问题解决了没有?