Re: recovering from a validation exception
Re: recovering from a validation exception
- Subject: Re: recovering from a validation exception
- From: Alexandre Mainville <email@hidden>
- Date: Wed, 20 Apr 2005 22:20:57 -0400
Hi,
Thanks for your help.
Unless the WO or EOF framework is doing something I'm not aware of and that is not tracable with
EOAdaptorDebugEnabled, I'm certain no changes have been made on the database (I'm the only user on a single instance).
The app already handles valid optimistic locking exceptions gracefully by warning the user and refaulting.
Here is the exception I get:
java.lang.IllegalStateException: Server exception: Optimistic locking failure: The object with global ID _EOIntegralKeyGlobalID[Test (java.lang.Integer)1] has been changed by another client
at com.webobjects.eodistribution.client.EODistributedObjectStore._checkReturnValuesForExceptions(EODistributedObjectStore.java:565)
at com.webobjects.eodistribution.client.EODistributedObjectStore._send(EODistributedObjectStore.java:593)
at com.webobjects.eodistribution.client.EODistributedObjectStore.saveChangesInEditingContext(EODistributedObjectStore.java:423)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3148)
at temp.client.temp.saveChanges(temp.java:29)
at com.webobjects.eoapplication.EODocumentController._saveIfUserConfirms(EODocumentController.java:670)
at com.webobjects.eoapplication.EODocumentController.save(EODocumentController.java:617)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:120)
at com.webobjects.eointerface.swing.EOControlActionAdapter.actionPerformed(EOControlActionAdapter.java:116)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1819)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1872)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
at java.awt.Component.processMouseEvent(Component.java:5166)
at java.awt.Component.processEvent(Component.java:4963)
at java.awt.Container.processEvent(Container.java:1613)
at java.awt.Component.dispatchEventImpl(Component.java:3681)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3242)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
at java.awt.Container.dispatchEventImpl(Container.java:1657)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Alex
On 20-Apr-05, at 8:19 PM, Sacha Mallais wrote:
On Apr 20, 2005, at 1:11 pm, Alexandre Mainville wrote:
Is it necessary to revert an eo that caused a validation exception in a java client application?
You definitely should not need to. Of course, you won't be able to commit that eo until it is valid.
Failure to do so seems to produce spurious optimistic locking exceptions with subsequent saves.
That's strange. Is there any chance that something else commits to the database? Can you post the exception?
FYI, here are the relevant Apple docs:
http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/UpdateStrategies/chapter_9_section_1.html
sacha
--
Sacha Michel Mallais - 400 lb. chimp
Global Village Consulting Inc.: http://www.global-village.net/
Choke on that, causality! -- the Professor, "Futurama"
_______________________________________________
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