Re: recovering from a validation exception
Re: recovering from a validation exception
- Subject: Re: recovering from a validation exception
- From: Philippe Rabier <email@hidden>
- Date: Mon, 2 May 2005 17:34:56 +0200
>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
We had this kind of exception in the past and we have resolved it.
We set the controller of our main window as the delegate of the eoDistributedObjectStore like this :
public void connectionWasEstablished() {
...
EODistributedObjectStore lc_store = (EODistributedObjectStore) editingContext().parentObjectStore();
lc_store.distributionChannel().setDelegate(this);
}
and we have implemented the method distributionChannelShouldThrowServerException like this :
public Throwable distributionChannelShouldThrowServerException(EODistributionChannel channel,
Throwable clientExceptionForServerException,
String originalServerExceptionClassName, String originalServerExceptionMessage) {
System.out.println("originalServerExceptionClassName " + originalServerExceptionClassName);
System.out.println("originalServerExceptionMessage " + originalServerExceptionMessage);
EOApplication.sharedApplication().refreshData();
return clientExceptionForServerException;
}
I thought that the msg "the object with global ID ... has been changed by another client" is a bug, or it's the wrong msg. The code example is a tunraround.
PR _______________________________________________
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