Re: Handling exceptions when saving editing conext changes
Re: Handling exceptions when saving editing conext changes
- Subject: Re: Handling exceptions when saving editing conext changes
- From: Chuck Hill <email@hidden>
- Date: Wed, 25 Mar 2009 11:57:15 -0700
Hail King Hafsteinsson!
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()
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
Chuck
--
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