On Aug 24, 2011, at 9:45 AM, Chuck Hill wrote:

> Hi Ramsey,
> 
> On 2011-08-24, at 9:42 AM, Ramsey Gurley wrote:
>> 
>> Just thought I would add that if you are using wonder's database context 
>> delegate, you can also provide your own ERXSQLHelper.OracleSQLHelper 
>> subclass via a property 
>> 
>> Oracle.SQLHelper=com.whatever.MyOracleHelper
>> 
>> and override the handleDatabaseException method on it to handle the general 
>> adaptor exception that happens when the unique constraint fails.
>> 
>> As Chuck mentioned, the quality of the message you receive from your 
>> database may make this approach useless (ahem... MySQL), but if you can 
>> figure out the modeled index from your database exception, this might do the 
>> trick.
>> 
>> Also, if you do it this way, make sure you call context.rollbackChanges 
>> before throwing your validation exception.
> 
> 
> Wasn't there some problem with this, like it did not work?  Or did you get 
> that fixed?  I recall someone trying this and it ending in unhappiness.
> 
> 
> Chuck

The main unhappiness I think came from the fact my implementation on MySQL 
forgot to call context.rollbackChanges.  That's not documented and I only found 
it after the fact with jad.

I think the basic approach is still a valid one.  I know Postgresql returns an 
index name, so I would consider this approach with it. I haven't gotten around 
to trying it tho.

Ramsey _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to