Enum Isolation

  • All Implemented Interfaces:
    Serializable, Comparable<Isolation>

    public enum Isolation
    extends Enum<Isolation>
    Enumeration that represents transaction isolation levels for use with the connection data source.
    • NONE
    • READ_UNCOMMITTED
    • READ_COMMITTED
    • REPEATABLE_READ
    • SERIALIZABLE
    Author:
    Alisson Gomes
    • Enum Constant Detail

      • DEFAULT

        public static final Isolation DEFAULT
        Use the default isolation level of the underlying connection data source. This level cannot be set at connection isolation.
      • NONE

        public static final Isolation NONE
        Transactions are not supported
      • READ_UNCOMMITTED

        public static final Isolation READ_UNCOMMITTED
        Dirty reads, non-repeatable reads and phantom reads can occur.
      • READ_COMMITTED

        public static final Isolation READ_COMMITTED
        Dirty reads are prevented; non-repeatable reads and phantom reads can occur.
      • REPEATABLE_READ

        public static final Isolation REPEATABLE_READ
        Dirty reads and non-repeatable reads are prevented; phantom reads can occur.
      • SERIALIZABLE

        public static final Isolation SERIALIZABLE
        Dirty reads, non-repeatable reads and phantom reads are prevented.
    • Method Detail

      • values

        public static Isolation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Isolation c : Isolation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Isolation valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • level

        public abstract int level()
      • get

        public static Isolation get​(int level)
      • get

        public static Isolation get​(String type)
        Parameters:
        type - String that represent enum ignoring case
        Returns:
        the value of type, type of not found return DEFAULT enum.