• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Integrity Constraints fire upon deletion.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrity Constraints fire upon deletion.


  • Subject: Re: Integrity Constraints fire upon deletion.
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 25 Apr 2007 17:42:37 -0700

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






_______________________________________________
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


  • Follow-Ups:
    • Re: Integrity Constraints fire upon deletion.
      • From: Gaastra Dennis - WO Lists <email@hidden>
References: 
 >Integrity Constraints fire upon deletion. (From: Gaastra Dennis - WO Lists <email@hidden>)

  • Prev by Date: Re: MultiECLockManager. Set and forget ?
  • Next by Date: Re: I'm killing my database
  • Previous by thread: Integrity Constraints fire upon deletion.
  • Next by thread: Re: Integrity Constraints fire upon deletion.
  • Index(es):
    • Date
    • Thread