On 15.08.2008, at 11:13, Chuck Hill wrote:

NOW, the hard part! For every save you are going to have to trap OptimisiticLocking exceptions and check if it failed on OrderNumer. If it did, you are going to need to call order.assignOrderNumber() again and repeat until the save succeeds. This will be problematic if you have multiple Orders being saved in one transaction.

Hmm, and there is one other rather serious problem: If another order saves first, it will update the snapshot for OrderNumber and you will not get the needed OptimisiticLocking exception. You would need to catch the Object Changed In Store notification and based on that updating OrderNumber, invalidate and re-assign the number you had previously generated.

It's probably easier to wrap the same idea inside some simple direct SQL statements.

cug

--
http://www.event-s.net

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to