枚举 Isolation

    • 枚举常量详细资料

      • DEFAULT

        public static final Isolation DEFAULT
        Use the default isolation level of the underlying datastore. All other levels correspond to the JDBC isolation levels.
        另请参阅:
        Connection
      • READ_UNCOMMITTED

        public static final Isolation READ_UNCOMMITTED
        A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur. This level allows a row changed by one transaction to be read by another transaction before any changes in that row have been committed (a "dirty read"). If any of the changes are rolled back, the second transaction will have retrieved an invalid row.
        另请参阅:
        Connection.TRANSACTION_READ_UNCOMMITTED
      • READ_COMMITTED

        public static final Isolation READ_COMMITTED
        A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur. This level only prohibits a transaction from reading a row with uncommitted changes in it.
        另请参阅:
        Connection.TRANSACTION_READ_COMMITTED
      • REPEATABLE_READ

        public static final Isolation REPEATABLE_READ
        A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur. This level prohibits a transaction from reading a row with uncommitted changes in it, and it also prohibits the situation where one transaction reads a row, a second transaction alters the row, and the first transaction rereads the row, getting different values the second time (a "non-repeatable read").
        另请参阅:
        Connection.TRANSACTION_REPEATABLE_READ
      • SERIALIZABLE

        public static final Isolation SERIALIZABLE
        A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented. This level includes the prohibitions in ISOLATION_REPEATABLE_READ and further prohibits the situation where one transaction reads all rows that satisfy a WHERE condition, a second transaction inserts a row that satisfies that WHERE condition, and the first transaction rereads for the same condition, retrieving the additional "phantom" row in the second read.
        另请参阅:
        Connection.TRANSACTION_SERIALIZABLE
    • 方法详细资料

      • values

        public static Isolation[] values()
        按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:
        for (Isolation c : Isolation.values())
            System.out.println(c);
        
        返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
      • valueOf

        public static Isolation valueOf​(String name)
        返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
        参数:
        name - 要返回的枚举常量的名称。
        返回:
        返回带有指定名称的枚举常量
        抛出:
        IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
        NullPointerException - 如果参数为空值
      • value

        public int value()