Hi

On 3/25/09 6:57 PM, "Chuck Hill" <[email protected]> wrote:

> Hail King Hafsteinsson!
> 
:D

> 
> On Mar 25, 2009, at 6:47 AM, Atli Páll Hafsteinsson wrote:
> 
>> My problem is the following:
>> 
>> We have a system that allows people to accept changes to their vehicle
>> registration online and the applications works as follows:
>> 
>> * changes are made to an existing eo-object
>> * the changes to the editing contex are saved
>> (editingContext.saveChanges())
>> * an email notifying the user that the changes have been made is
>> sent out
>> 
>> However we've had a scenario when the .saveChanges() failed without
>> the
>> application noticing and the notification email was sent out even
>> though the
>> changes where not really made in the database.
> 
> How is that possible?  Are you using Wonder?  There is public void
> didUpdate() on ERXGenericRecord that should _only_ get called if the
> save succeeds.  If you are using Practical WebObjects / GVC Frameworks
> code, the method is  public void hasUpdated()
> 
> 
> 
When reading your answear I figured that I was ofcourse lieing !! The code
sent out the notification email before it tryed to save the changes to the
database, very good :) My new code however does not and catches and logs
errors :) 

.. And yes we use wonder :)


>> What is the best way to catch exceptions when .saveChanges() fails ?
>> 
>> try {
>>       ec.saveChanges();
>> } catch (Exception e) {
>>        //Do stuff to handle error
>> }
>> 
>> Or is there a better way ?
> 
> That should do it, excepting JVM errors like OutOfMemory
> 

Should be sufficient, thanx for the help.

Atli
> 
> Chuck
> 


Fyrirvari á tölvupósti / e-mail disclaimer
http://us.is/Apps/WebObjects/US.woa/wa/dp?id=3776


 _______________________________________________
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