Can't get locking exception
Can't get locking exception
- Subject: Can't get locking exception
- From: Jeff Schmitz <email@hidden>
- Date: Fri, 09 Jan 2009 22:21:43 -0600
When using editing contexts created with:
ERXEC.newEditingContext();
I can't seem to cause an optimistic locking exception to be tripped (I'm trying to test my exception handling). It always just saves the last set of data that was submitted. What I do is open the same record in my web app in two different browser windows under 2 different sessions. I then change something in one window and save the new data. Then I change something different in the other window and save it (i.e. ec.saveChanges()). I expected to get an exception at this point, but instead the save works and just writes over the changes from the previous save with its own set of data. What could be causing this? Or is my thinking on what should throw an optimistic locking exception incorrect? I thought this was the functionality of the tolerant editing context, but not the default one.
try { entry.editingContext().saveChanges(); } catch (EOGeneralAdaptorException saveException) { //error handling code handleOptimisticLockingFailureByRefaulting(entry.editingContext(), saveException); //code to bring up error page... }
I did step through with the debugger too, and no exception is raised.
Thanks, Jeff |
_______________________________________________
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