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
一个方法里面,插入数据后,我故意抛出异常, 数据并没有被回滚

请问这个问题怎么解决?
...全文
250 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hbyufan 2009-03-16
  • 打赏
  • 举报
回复
关注,问题解决了没有?

2,633

社区成员

发帖
与我相关
我的任务
社区描述
WebSphere 是 IBM 的软件平台。它包含了编写、运行和监视全天候的工业强度的随需应变 Web 应用程序和跨平台、跨产品解决方案所需要的整个中间件基础设施,如服务器、服务和工具。
社区管理员
  • WebSphere社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧