Spring 3.0 - @Transactional 运行时更改超时
我们在我的项目中使用 Spring 3.0/Hibernate/Weblogic-websphere - Oracle。 对于事务管理,我们使用@Transactional注释。我有两个问题/疑虑,希望能得到你们的帮助。
1)是否可以根据条件在运行时更改事务的超时?
2)是否可以在配置xml中设置每个方法的超时但仍然使用@transactional注释?
请帮帮我!!
- 莫罕
We are using Spring 3.0/Hibernate/Weblogic-websphere - Oracle in my project.
For transaction management, we are using @Transactional annotation. I have two Questions/concerns, which I hope to get some help from you guys.
1) Is it possible to change the Transaction's timeout during the runtime based on a condition?
2) Is it possible to set the timeout per method in a config xml but still use @transactional annotation?
Please help me out!!
- Mohan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定第一个问题,但第二个问题的答案是肯定的。
http://static .springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/transaction/annotation/Transactional.html
根据此文档
@Transactional
注解有超时参数:I'm not sure about first question, but the answer for the second question is Yes.
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/transaction/annotation/Transactional.html
According to this documentation
@Transactional
annotoation has timeout paramter: