You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ch...@apache.org on 2014/06/05 21:44:59 UTC

svn commit: r1600742 - in /db/derby/docs/trunk/src/ref: rrefjtadefconstr.dita rrefsqlj13590.dita

Author: chaase3
Date: Thu Jun  5 19:44:58 2014
New Revision: 1600742

URL: http://svn.apache.org/r1600742
Log:
DERBY-6571  Document deferrable constraints

Modified 2 Reference Manual topics. 

Patches: DERBY-6571-7.diff

Modified:
    db/derby/docs/trunk/src/ref/rrefjtadefconstr.dita
    db/derby/docs/trunk/src/ref/rrefsqlj13590.dita

Modified: db/derby/docs/trunk/src/ref/rrefjtadefconstr.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefjtadefconstr.dita?rev=1600742&r1=1600741&r2=1600742&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefjtadefconstr.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefjtadefconstr.dita Thu Jun  5 19:44:58 2014
@@ -25,9 +25,15 @@ limitations under the License.
 <p>If an application calls <i>XAResource.prepare(Xid)</i>, any constraints with
 a constraint mode of DEFERRED are checked. If there is a violation,
 <ph conref="../conrefs.dita#prod/productshortname"></ph> throws
-<i>XAException.XA_RBINTEGRITY</i>, and the XA transaction is rolled back. See
-<xref href="rrefsqlj13590.dita"/> and <xref href="rrefsqljsetconstr.dita"/> for
-more information about deferrable constraints.</p>
+<i>XAException.XA_RBINTEGRITY</i>, and the XA transaction is rolled back.</p>
+<p>If an application calls <i>XAResource.commit(Xid, true)</i> (with <i>true</i>
+indicating a one-phase commit), any constraints with a constraint mode of
+DEFERRED are checked. If there is a violation,
+<ph conref="../conrefs.dita#prod/productshortname"></ph> throws
+<i>XAException.XA_RBINTEGRITY</i>, and the XA transaction is rolled back.</p>
+<p>See <xref href="rrefsqlj13590.dita"/> and
+<xref href="rrefsqljsetconstr.dita"/> for more information about deferrable
+constraints.</p>
 </section>
 </refbody>
 </reference>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj13590.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj13590.dita?rev=1600742&r1=1600741&r2=1600742&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj13590.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj13590.dita Thu Jun  5 19:44:58 2014
@@ -89,9 +89,10 @@ details.</p>
 constraints immediately. By default, a constraint is checked as soon as a
 statement completes. Deferrable constraints allow temporary breaches of
 constraints for more flexible insert and update operations.</p>
-<p>With deferrable constraints, the checking of one or more constraints does not
-take place until it is explicitly or implicitly requested using one of the
-following mechanisms:</p>
+<p>When a deferrable constraint's constraint mode is DEFERRED before execution
+of a statement starts, the checking of the constraint does not take place at the
+end of the statement execution as usual, but only when it is explicitly or
+implicitly requested using one of the following mechanisms:</p>
 <ul>
 <li>The transaction ends (a commit operation takes place)</li>
 <li>A <xref href="rrefsqljsetconstr.dita">SET CONSTRAINTS statement</xref> which
@@ -150,7 +151,10 @@ omit the column list for the referenced 
 primary key.</p> <p>If there is no column list in the <i>ReferencesSpecification </i>and
 the referenced table has no primary key, a statement exception is thrown.
 (This means that if the referenced table has only unique keys, you must include
-a column list in the <i>ReferencesSpecification.</i>)</p> <p>A foreign key
+a column list in the <i>ReferencesSpecification.</i>)</p>
+<p>If the REFERENCES clause contains a CASCADE or SET NULL referential action,
+the primary or unique key referenced must not be deferrable.</p>
+<p>A foreign key
 constraint is satisfied if there is a matching value in the referenced unique
 or primary key column. If the foreign key consists of multiple columns, the
 foreign key value is considered NULL if any of its columns contains a NULL.
@@ -170,9 +174,13 @@ every foreign key constraint that refere
 removal or modification of the row does not cause a constraint violation.
 If removal or modification of the row would cause a constraint violation,
 the update or delete is not permitted and <ph conref="../conrefs.dita#prod/productshortname"></ph> throws
-a statement exception.</p> <p><ph conref="../conrefs.dita#prod/productshortname"></ph> performs
-constraint checks at the time the statement is executed, not when the transaction
-commits.</p> </section>
+a statement exception.</p>
+<p>If the constraint mode is IMMEDIATE (the default),
+<ph conref="../conrefs.dita#prod/productshortname"></ph> performs constraint
+checks at the time the statement is executed. If the constraint mode is
+DEFERRED, the checking is done later, typically at commit time. See
+<xref href="rrefsqlj13590.dita#rrefsqlj13590/deferrableconstraints"></xref> for
+more information.</p> </section>
 <section><title>Backing indexes</title> <p><indexterm>Backing indexes<indexterm>created
 automatically to enforce primary key, unique, and foreign key  constraints</indexterm></indexterm><indexterm>Indexes<indexterm>automatic
 creation of for primary key, unique, and foreign key constraints</indexterm></indexterm>UNIQUE,