websphere的transaction如何跟SPRING的配置结合
icey 2008-08-06 11:19:04 以前一直用weblogic,现在要把程序的目标AP变成WEBSPHERE,
我在SPRING配置中的transaction配置如下
<bean id="wsJM" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean"/>
<!-- Transaction Managers -->
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"
scope="singleton">
<property name="transactionManager" ref="wsJM"/>
</bean>
<!-- Transaction Configuration -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="create*" propagation="REQUIRED" isolation="READ_COMMITTED" timeout="300" rollback-for="Throwable"/>
<tx:method name="update*" propagation="REQUIRED" isolation="READ_COMMITTED" timeout="300" rollback-for="Throwable"/>
<tx:method name="delete*" propagation="REQUIRED" isolation="READ_COMMITTED" timeout="300" rollback-for="Throwable"/>
<tx:method name="run*" propagation="REQUIRED" isolation="READ_COMMITTED" timeout="300" rollback-for="Throwable"/>
<tx:method name="find*" propagation="SUPPORTS" isolation="READ_COMMITTED" read-only="true" timeout="300" rollback-for="Throwable"/>
<tx:method name="is*" propagation="SUPPORTS" isolation="READ_COMMITTED" read-only="true" timeout="300" rollback-for="Throwable"/>
<tx:method name="count*" propagation="SUPPORTS" isolation="READ_COMMITTED" read-only="true" timeout="300" rollback-for="Throwable"/>
</tx:attributes>
</tx:advice>
<!-- Auto proxying -->
<bean id="ServiceAutoProxyBeanCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>txAdvice</value>
</list>
</property>
</bean>
这种配置,我在使用时候,执行create一些方法时候,系统会报错,说JtaTransactionManager does not support custom isolation levels by default - switch 'allowCustomIsolationLevels' to 'true'
我按他建议的,把'allowCustomIsolationLevels' 设置成true, 运行时可以, 但是我试验过transaction
一个方法里面,插入数据后,我故意抛出异常, 数据并没有被回滚
请问这个问题怎么解决?