• 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: How to get the failing EO when a unique constraint violation occurs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the failing EO when a unique constraint violation occurs?


  • Subject: Re: How to get the failing EO when a unique constraint violation occurs?
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 11 Jan 2010 22:07:04 -0800

Hi Amiel,

You can only get it if you are not using deferred constraints. If you are using deferred constraints, the exception is only thrown at the end of the transaction and EOF has no way of knowing which EO caused the error. The best solution that I have found is to parse out the table name and use that to infer the entity. If you are using single table inheritance, this is not perfect, but as all entities in the inheritance hierarchy will have to have the same constraint the error is probably also consistent. If you can get the entity name, you can then form a reasonable error message.


Chuck


On Jan 11, 2010, at 9:56 PM, Amiel Montecillo wrote:

Hi Everyone,

Is it possible to get the failed EO instance when an unique constraint violation occurs? I have been digging in EOGeneralAdaptorException but I couldn't figure out how to get the instance of the EO that has failed.

Rgds,
Amiel

--
socket error: unable to connect to 127.0.0.1
_______________________________________________
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

-- Chuck Hill Senior Consultant / VP Development

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: How to get the failing EO when a unique constraint violation occurs?
      • From: Amiel Montecillo <email@hidden>
References: 
 >How to get the failing EO when a unique constraint violation occurs? (From: Amiel Montecillo <email@hidden>)

  • Prev by Date: How to get the failing EO when a unique constraint violation occurs?
  • Next by Date: Re: How to get the failing EO when a unique constraint violation occurs?
  • Previous by thread: How to get the failing EO when a unique constraint violation occurs?
  • Next by thread: Re: How to get the failing EO when a unique constraint violation occurs?
  • Index(es):
    • Date
    • Thread