Java EE (9) -- JDBC & JTA
2015-10-09 11:35
525 查看
Connection接口中定义了5中隔离级别常量
Connection.TRANSACTION_NONE -- 不支持事务
Connection.TRANSACTION_READ_UNCOMMITTED -- 脏读(事务回滚造成别的事务读取到的数据不准确),不可重复读和幻读均可发生
Connection.TRANSACTION_READ_COMMITTED -- 不可重复读和幻读均可发生
Connection.TRANSACTION_REPEATABLE_READ – 幻读发生(表一记录学生,表二记录表一统计信息。)
Connection.TRANSACTION_SERIALIZABLE -- 可串行化事务
Javax.ejb.TransactionAttributeType枚举中定义的事务属性:
TransactionAttributeType.MANDATORY
If a client invokes the enterprise bean's method while the client is associated with a transaction context, the container invokes the enterprise bean's method in the client's transaction context.
TransactionAttributeType.NEVER
The client is required to call without a transaction context, otherwise an exception is thrown.
TransactionAttributeType.NOT_SUPPORTED
The container invokes an enterprise bean method whose transaction attribute NOT_SUPPORTED with an unspecified transaction context.
TransactionAttributeType.REQUIRED
If a client invokes the enterprise bean's method while the client is associated with a transaction context, the container invokes the enterprise bean's method in the client's transaction context.
TransactionAttributeType.REQUIRES_NEW
The container must invoke an enterprise bean method whose transaction attribute is set to REQUIRES_NEW with a new transaction context.
TransactionAttributeType.SUPPORTS
If the client calls with a transaction context, the container performs the same steps as described in the REQUIRED case.
Connection.TRANSACTION_NONE -- 不支持事务
Connection.TRANSACTION_READ_UNCOMMITTED -- 脏读(事务回滚造成别的事务读取到的数据不准确),不可重复读和幻读均可发生
Connection.TRANSACTION_READ_COMMITTED -- 不可重复读和幻读均可发生
Connection.TRANSACTION_REPEATABLE_READ – 幻读发生(表一记录学生,表二记录表一统计信息。)
Connection.TRANSACTION_SERIALIZABLE -- 可串行化事务
Javax.ejb.TransactionAttributeType枚举中定义的事务属性:
TransactionAttributeType.MANDATORY
If a client invokes the enterprise bean's method while the client is associated with a transaction context, the container invokes the enterprise bean's method in the client's transaction context.
TransactionAttributeType.NEVER
The client is required to call without a transaction context, otherwise an exception is thrown.
TransactionAttributeType.NOT_SUPPORTED
The container invokes an enterprise bean method whose transaction attribute NOT_SUPPORTED with an unspecified transaction context.
TransactionAttributeType.REQUIRED
If a client invokes the enterprise bean's method while the client is associated with a transaction context, the container invokes the enterprise bean's method in the client's transaction context.
TransactionAttributeType.REQUIRES_NEW
The container must invoke an enterprise bean method whose transaction attribute is set to REQUIRES_NEW with a new transaction context.
TransactionAttributeType.SUPPORTS
If the client calls with a transaction context, the container performs the same steps as described in the REQUIRED case.
相关文章推荐
- Java发送邮件javax.mail
- Java学习之Iterator(迭代器)的一般用法
- java例子5:平面圆,继承圆
- Spring下classpath与classpath*的区别
- Java正则表达式过滤汉字
- java 小知识
- mac版eclipse在retina屏幕显示模糊的问题
- Java Web Filter之登录验证
- java实现注销登录的2种方式区别
- 通过java反射获取任意对象的字段名及字段值
- myeclipse 下 fineReport 报表制作流程简介
- Java随机生成6位数字
- java 校验和
- java装箱拆箱的运行性能问题
- Java双缓冲技术
- 【java】json格式解析
- Java输入输出流的使用详细介绍
- Java(4)--多线程
- Struts2的自定义返回类型
- [java] java中函数的 参数传递 详解