File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
hibernate-core/src/main/java/org/hibernate Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 3434 * which any pessimistic lock is already held has no effect,
3535 * and does not force a version increment.
3636 * <p>
37+ * When an entity is read from the database, its lock mode
38+ * determines whether lost updates and non-repeatable reads
39+ * are possible.
40+ * <ul>
41+ * <li>{@link #NONE} and {@link #READ} prevent lost updates
42+ * only for versioned entities, but do not prevent
43+ * non-repeatable reads, and do not prevent lost updates
44+ * for entities with no version attribute.
45+ * <li>{@link #OPTIMISTIC} and {@link #OPTIMISTIC_FORCE_INCREMENT}
46+ * prevent lost updates and non-repeatable reads only for
47+ * versioned entities.
48+ * <li>{@link #PESSIMISTIC_READ}, {@link #PESSIMISTIC_WRITE},
49+ * and {@link #PESSIMISTIC_FORCE_INCREMENT} prevent lost
50+ * updates and non-repeatable reads for all entities,
51+ * including entities with no version attribute.
52+ * </ul>
53+ * <p>
3754 * This enumeration of lock modes competes with the JPA-defined
3855 * {@link LockModeType}, but offers additional options, including
3956 * {@link #UPGRADE_NOWAIT} and {@link #UPGRADE_SKIPLOCKED}.
You can’t perform that action at this time.
0 commit comments