Interface FlushSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringControls whether deferrable constraints can be broken (nullified + fixup UPDATE) to resolve cycles.static final StringControls whether deferrable constraints should create dependency edges in the flush graph.static final StringSpecifies theActionQueueimplementation to use.static final StringWhether the graph-based action queue should defer IDENTITY inserts into the normal flush plan.static final StringWhether to order operations by foreign-key as part of graph-based flush planning.static final StringWhether to order operations by unique-key as part of graph-based flush planning.
-
Field Details
-
FLUSH_QUEUE_TYPE
Specifies the
ActionQueueimplementation to use. Valid values are defined byQueueType:- "graph" (default) - Uses the graph-based ActionQueue implementation, which handles planning automatically based on defined constraints (foreign key dependencies, unique keys, ...).
- "legacy" - Uses the traditional ActionQueue implementation, which requires hard-coded ordering and manual sorting of actions
- Since:
- 8.0
- See Also:
- API Note:
- The legacy implementation remains available by explicitly setting
this property to
"legacy". - Default Value:
"graph"
-
ORDER_BY_FOREIGN_KEY
Whether to order operations by foreign-key as part of graph-based flush planning.- Since:
- 8.0
- See Also:
- Default Value:
- true
-
ORDER_BY_UNIQUE_KEY
Whether to order operations by unique-key as part of graph-based flush planning.- Since:
- 8.0
- See Also:
- Default Value:
- true
-
DEFERRABLE_EDGES_IGNORE
Controls whether deferrable constraints should create dependency edges in the flush graph.
Assuming a constraint is deferrable -
When true (default) - Hibernate expects the database will handle constraint checking at commit - Hibernate doesn't need to worry about execution order for these constraints - Result: Fewer edges → simpler graph → potentially better execution order
When false - Add deferrable constraints as graph edges even though DB can defer them - Hibernate still controls execution order - More conservative (works even if DB doesn't actually defer)
Note this simply creates edges. Whether we decide to break these edges when a cycle is detected is still controlled by
DEFERRABLE_AVOID_BREAK. The information is sometimes useful even though we may not break these edges.- Since:
- 8.0
- See Also:
- Default Value:
- true
-
DEFERRABLE_AVOID_BREAK
Controls whether deferrable constraints can be broken (nullified + fixup UPDATE) to resolve cycles.
Assuming a constraints is deferrable -
When true (default) - Avoid breaking deferrable constraints if possible - Prefer breaking non-deferrable constraints in cycles - Preference achieved by assigning a higher cost to breaking these edges - Only break deferrable constraints if no other option exists. If the database can defer the constraint, why break it? Let the database handle it.
When false - Deferrable constraints can be broken just like any other nullable constraint - If cycle breaking is needed, deferrable constraints are fair game
- Since:
- 8.0
- See Also:
- Default Value:
- true
-
GRAPH_DEFER_IDENTITY_INSERTS
Whether the graph-based action queue should defer IDENTITY inserts into the normal flush plan.
When
false(default), the graph queue preserves legacy behavior and executes non-delayed IDENTITY inserts immediately so generated identifiers are visible afterpersist().When
true, IDENTITY inserts are planned with the rest of the flush and generated identifiers are resolved through graph-generated value handles.- Since:
- 8.0
- See Also:
- Default Value:
- false
-