• 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
Re: sequential numbering across more instances
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sequential numbering across more instances


  • Subject: Re: sequential numbering across more instances
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 15 Aug 2008 18:12:51 -0700

Hi Alan!


On Aug 15, 2008, at 5:47 PM, Alan Ward wrote:
On Aug 15, 2008, at 6:24 PM, Chuck Hill wrote:
On Aug 15, 2008, at 1:48 PM, Mike Schrag wrote:

Sometimes the app is not the right level for solving the problem. I do try to avoid things like this, but sometimes they are the best solution.
Why would you choose this route rather than selecting from your db's sequence generator from WO (assuming your db has sequences)? I mean, if you're doing db-specific things anyway?

I think the goal is to avoid gaps in the sequence. Gappy solutions are a dime a dozen. ;-) That is more easily done at the end of a transaction at the database level. I _think_ an After Insert trigger should avoid sequence gaps.

That would do it, yes. Have EOF insert the record with a null value in the column and use a trigger (after insert) to assign the value from a sequence.

Good. It has been some years since I last resorted to this. Memory seems to fade with age.



Be aware though that you should not lock on that column or else you'll run into optimistic locking failures if you subsequently update any other column before refetching the (now modified) EO.


In Ondra's case, this value is editable. So it may be preferable to instead immediately invalidate the Order object as soon as it has been saved. This will avoid this problem (the snapshot will be discarded) and allow for locking on this column.

As I said earlier, much fun here!  :-)

Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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: sequential numbering across more instances
      • From: Ondřej Čada <email@hidden>
References: 
 >sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Florijan Stamenkovic <email@hidden>)
 >Re: sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Guido Neitzer <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Ondřej Čada <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Mike Schrag <email@hidden>)
 >Re: sequential numbering across more instances (From: Chuck Hill <email@hidden>)
 >Re: sequential numbering across more instances (From: Alan Ward <email@hidden>)

  • Prev by Date: Re: sequential numbering across more instances
  • Next by Date: Re: sequential numbering across more instances
  • Previous by thread: Re: sequential numbering across more instances
  • Next by thread: Re: sequential numbering across more instances
  • Index(es):
    • Date
    • Thread