Subject | Re: [ib-support] Deferring Constraint Checking |
---|---|
Author | Todd Brasseur |
Post date | 2003-05-28T22:05:37Z |
I use triggers to accomplish this (AFTER INSERT and AFTER UPDATE)
Todder
Jack Frosch wrote:
Todd Brasseur, A.M.A.A.
COMPASS Municipal Services Inc.
[Non-text portions of this message have been removed]
Todder
Jack Frosch wrote:
> Is it possible to configure Firebird to defer constraint checking--
> until a commit?
>
> I'm using Firebird on a J2EE Enterprise JavaBeans (EJB) application
> using the JBoss application server. Because of the peculiarities of
> EJB and JBoss, I'm wanting to defer the constraint checking until the
> transaction is committed. I've been told Oracle will allow this, so I
> thought I'd ask if Firebird/FirebirdSQL has such a configuration
> option.
>
> FYI Background: In EJB, the insert of a row is performed in an
> ejbCreate method, then the relationhip between one entity and another
> is configured in the ejbPostCreate method. The problem is,
> Firebird/FirebirdSQL is checking the constraint immediately on the
> INSERT of the row (in the ejbCreate method) before JBoss ever gets a
> chance to manage the relationship. At that point, the value for the
> foreign key column, which is NOT NULL, is null, and an exception is
> thrown.
>
> In pseudo-SQL, what I think the app server wants to do is something
> like this:
>
> // ejbCreate method does this
> INSERT INTO childTable ... (no value for FK column)
>
> // ejbPostCreate method does this
> UPDATE childTable ... (set FK column value to non null)
>
> // commit causes constraints to be checked
> COMMIT;
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> Click Here!
> <http://rd.yahoo.com/M=244522.3313099.4604523.1512248/D=egroupweb/S=1705115386:HM/A=1595053/R=0/*http://ashnin.com/clk/muryutaitakenattogyo?YH=3313099&yhad=1595053>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.
Todd Brasseur, A.M.A.A.
COMPASS Municipal Services Inc.
[Non-text portions of this message have been removed]