关于javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional
来源:互联网 发布:软件测试标准规范 编辑:程序博客网 时间:2024/06/04 19:28
@Transactional有两个不同的包。在Spring的事务管理中应该使用org.springframework.transaction.annotation.Transactional
在Java EE 7 应用中,应该使用javax.transaction.Transactional。
英文:
Spring has defined its own Transactional annotation to make Spring bean methods transactional, years ago.
Java EE 7 has finally done the same thing and now allows CDI bean methods to be transactional, in addition to EJB methods. So since Java EE 7, it also defines its own Transactional annotation (it obviously can't reuse the Spring one).
In a Java EE 7 application, you'll use the Java EE annotation.
In a Spring application, you'll use the Spring annotation.
Their use is the same: informing the container (Java EE or Spring) that a method is transactional.
- 关于javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional
- 关于org.springframework.transaction.CannotCreateTransactionException问题
- org.springframework.transaction.CannotCreateTransactionException:
- javax.transaction.Transaction翻译
- org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has
- org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has
- Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.interceptor.Transaction
- org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has
- org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has
- org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- spring:org.springframework.transaction.UnexpectedRollbackException解决
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- org.hibernate.transaction.JDBCTransaction cannot be cast to javax.transaction.Transaction
- 报错信息:Type mismatch: cannot convert from org.hibernate.Transaction to javax.transaction.Transaction
- @Transactional
- @Transactional
- VMware Workstation装Mac OS X出现无法恢复错误vcpu-0
- 来自谷歌的MVP的示例
- leetcode之Binary Tree Level Order Traverse
- Problem 1608 - Calculation 【状压dp】
- 混合专家系统(Mixture of experts)
- 关于javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional
- hellocharts_柱状图
- __attribute__((regparm(n)))
- 互联网--评微软等公司数据结构和算法面试100题 .
- 计算理论初步:P vs NP 问题
- 正则表达式
- [iOS]UIView动画总结
- LeetCode *** 290. Word Pattern
- cscope插件,项目根目录、任意子目录下打开vim自动加载cscope.out