• 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: ERXValidationException out of a Unique Constraint Violation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERXValidationException out of a Unique Constraint Violation


  • Subject: Re: ERXValidationException out of a Unique Constraint Violation
  • From: Timo Hoepfner <email@hidden>
  • Date: Tue, 27 May 2008 22:12:43 +0200


Am 27.05.2008 um 20:05 schrieb Chuck Hill:

The thing is, as I expect Paul has found out, is that this won't work reliably. Something else can add the value to the database between when you make this check and when the SQL transaction is committed.
...


On May 27, 2008, at 11:01 AM, Zak Burke wrote:

I wrote some simple "validateUniquenessOf..." methods that you can stash in a custom EO superclass. The content is pasted below; you can also just search for "uniquness" on www.wocode.com.


I added Zak's idea to Wonder a while ago (ERXEOControlUtilities.validateUniquenessOf(...)). There are still situations, where it cannot work as expected, so you should always add a corresponding unique constraint in the database.


I thought about handling the EOGeneralAdaptorException caused by a unique index violation by using a ERXEC delegate, which in turn would use the DB specific ERXSQLHelper just today, but that one would fail in other situations...

I really would like to find a "foolproof" solution for this problem (and another one for a DB agnostic "version=version+1")...

Timo

_______________________________________________
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: ERXValidationException out of a Unique Constraint Violation
      • From: Chuck Hill <email@hidden>
References: 
 >ERXValidationException out of a Unique Constraint Violation (From: Paul Stringer <email@hidden>)
 >Re: ERXValidationException out of a Unique Constraint Violation (From: "Zak Burke" <email@hidden>)
 >Re: ERXValidationException out of a Unique Constraint Violation (From: Chuck Hill <email@hidden>)

  • Prev by Date: Install WO 5.3/WOLips on Ubuntu
  • Next by Date: Re: Setting up WebObjects on MacOSX Server 10.5.2
  • Previous by thread: Re: ERXValidationException out of a Unique Constraint Violation
  • Next by thread: Re: ERXValidationException out of a Unique Constraint Violation
  • Index(es):
    • Date
    • Thread