conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
...
static int TRANSACTION_NONE
A constant indicating that transactions are not supported.
static int TRANSACTION_READ_COMMITTED
A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur.
static int TRANSACTION_READ_UNCOMMITTED
A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur.
static int TRANSACTION_REPEATABLE_READ
A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur.
static int TRANSACTION_SERIALIZABLE
A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented.
setTransactionIsolation
最新推荐文章于 2024-12-29 16:04:34 发布
本文详细介绍了SQL中五种不同的事务隔离级别:无事务、读未提交、读已提交、可重复读及串行化。每种级别的描述都涵盖了可能发生的脏读、不可重复读和幽灵读等问题。
4438

被折叠的 条评论
为什么被折叠?



