Re: Integrity Constraints fire upon deletion.
Re: Integrity Constraints fire upon deletion.
- Subject: Re: Integrity Constraints fire upon deletion.
- From: Chuck Hill <email@hidden>
- Date: Fri, 27 Apr 2007 12:31:12 -0700
Assuming that this exception is happening when EOF issues a commit
(and that ClientTransaction._C0000000083 is set to "Deferrable" and
"Initially Deferred"), then that looks like EOF is getting confused
between inserts, updates, and deletes. In otherwords, part way
though delete ... it changes into an update ... set fk = null
I have only ever seen that happen if you are not locking properly.
Are you?
Chuck
On Apr 27, 2007, at 12:24 PM, Gaastra Dennis - WO Lists wrote:
Hi Chuck and List,
Thanks for your intial help, but after setting all the "Check" and
"Foreign Key" constraints to "Deferrable" and "Initially Deferred"
in the "ClientTransaction" table, we still get a new type of
exception once in a while:
com.webobjects.jdbcadaptor.JDBCAdaptorException: Exception
condition 357. Integrity constraint violation (CHECK,
ClientTransaction._C0000000083(\"branch_id\" IS NOT NULL)).
During:
ec.deleteObject(trans);
session.defaultEditingContext().saveChanges(); <------
Any help is appreciated.
With Kind Regards,
Dennis Gaastra, M.B.A.[sfu.ca], B.Sc.[ubc.ca]
Chief Technology Officer,
On 25-Apr-07, at 5:42 PM, Chuck wrote:
Hi Dennis,
The issue here is that the DB operations generated by EOF are not
ordered (or not ordered well ;-). You need to create the FK
constraints as DEFERRABLE INITIALLY DEFERRED. For existing
databases, you will have to drop and recreate them. Once this is
done, FB won't check the constraints until the commit is issued.
You could also try ordering the operations, but making the FK
constraints deferred is much easier.
Chuck
On Apr 25, 2007, at 2:46 PM, Gaastra Dennis - WO Lists wrote:
Dear List,
Why does WebObjects or the Frontbase Adaptor sometimes set
(update) an instance's attributes to null instead of just
deleting it right away. As such, constraints fire up. This error
only happens 1 in 10 times, while deleting an instance from the
database.
ec.deleteObject(trans);
session.defaultEditingContext().saveChanges();
com.webobjects.eoaccess.EOGeneralAdaptorException:
EvaluateExpression failed:
<com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression:
"UPDATE "ClientTransaction" SET "branch_id" = NULL, "office_id" =
NULL, "division_id" = NULL, "client_id" = NULL WHERE
("clientTransaction_id" = 1008834 AND "office_id" = 1000001 AND
"branch_id" = 1000003)">:
Next exception:SQL State:23 subclass = 00 -- error
code: 357 -- msg: Exception condition 357. Integrity constraint
violation (CHECK, ClientTransaction._C0000000083(\"branch_id\" IS
NOT NULL)).
Next exception:SQL State:23 subclass = 00 -- error
code: 357 -- msg: Exception condition 357. Integrity constraint
violation (CHECK, ClientTransaction._C0000000088(\"office_id\" IS
NOT NULL)).
Next exception:SQL State:40 subclass = 00 -- error
code: 363 -- msg: Exception condition 363. Transaction rollback.
Thanks for any help.
With Kind Regards,
Dennis Gaastra, M.B.A.[sfu.ca], B.Sc.[ubc.ca]
Chief Technology Officer,
WEBAPPZ Systems, Inc.
HQ: (+1) 604.921.1333
Fax: (+1) 604.921.4313
Cell: (+1) 604.787.2532
Email: email@hidden
Web: www.webappz.com & www.1tracker.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list (Webobjects-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden