• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Can't get locking exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Can't get locking exception
      • From: Ken Anderson <email@hidden>
    • Re: Can't get locking exception
      • From: Mike Schrag <email@hidden>
  • Prev by Date: Re: Problem after Wonder and WO upgrade
  • Next by Date: Re: Manipulating large amounts of data with EOF - feedback, anyone?
  • Previous by thread: Re: Manipulating large amounts of data with EOF - feedback, anyone?
  • Next by thread: Re: Can't get locking exception
  • Index(es):
    • Date
    • Thread