In Hibernate 3.6, what is the support for deferred constraints?
As I get it, in 3.2, "Hibernate does not have support for deferred constraints." (from http://opensource.atlassian.com/projects/hibernate/browse/HHH-2248)
DEFERRED constraints are not checked until transaction commit. Each constraint has its own IMMEDIATE or DEFERRED mode. Upon creation, a constraint is given one of three characteristics: DEFERRABLE INITIALLY DEFERRED , DEFERRABLE INITIALLY IMMEDIATE , or NOT DEFERRABLE .
If a constraint is deferrable, this clause specifies the default time to check the constraint. If the constraint is INITIALLY IMMEDIATE, it is checked after each statement, which is the default. If the constraint is INITIALLY DEFERRED, it is checked only at the end of the transaction.
To recap, declaring a constraint deferrable allows transactions to defer validation until commit time.
When you add a DEFERRABLE constraint, you can mark it as INITIALLY IMMEDIATE or INITIALLY DEFERRED. INITIALLY IMMEDIATE means that the constraint is checked whenever you add, update, or delete rows from a table. INITIALLY DEFERRED means that the constraint is only checked when a transaction is committed.
The issue you linked was originally filed against Hibernate 3.2. It does not yet have a fix version and the status is open, which implies that the issue still exists and deferred constraints is not yet supported in any version of Hibernate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With