hibernate configure transaction Isolation Level
In the hibernate config file you can configure the default jdbc-transaction level. Hibernate uses the codes of the java.sql.Connection class, which are listed above.
4
Here a short list, what each level means:
- public static final int TRANSACTION_NONE = 0;
- public static final int TRANSACTION_READ_UNCOMMITTED = 1;
- public static final int TRANSACTION_READ_COMMITTED = 2;
- public static final int TRANSACTION_REPEATABLE_READ = 4;
- public static final int TRANSACTION_SERIALIZABLE = 8;
Here a short list, what each level means:
- TRANSACTION_READ_UNCOMMITTED -> Allows dirty reads, non-repeatable reads, and phantom reads to occur.
- TRANSACTION_READ_COMMITTED -> Ensures only committed data can be read.
- TRANSACTION_REPEATABLE_READ -> Is close to being “serializable,” however, “phantom” reads are possible.
- TRANSACTION_SERIALIZABLE -> Dirty reads, non-repeatable reads, and phantom reads are prevented. Serializable.
No comments:
Post a Comment