Use the suggestion about a read to verify the non-existence of the record and
then loop around until the time() function changes to a unique id.



> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: RE: [U2] Guaranteed unique sequential keys
> Date: Thu, 24 Apr 2008 11:02:26 -0500
>
> Consider using a lock-and-write thing...
>
> --Bill
>
>   SUBROUTINE SUB.LOCK.AND.WRITE.R2 ( R.This, This.File, Record.ID )
>
>   prompt ''
>
>   open This.File to F.This.File  else  gosub  Error.Opening.File
>
>   gosub Lock.And.Write
>
>   go    The.End
>
>
*---------------------------------------------------------------------------
> --
>
*---------------------------------------------------------------------------
> --
> Lock.And.Write:
>
>   Lock.Test = recordlocked (F.This.File, Record.ID)
>
> *crt 'This.File___ ' : F.This.File : ' ___ ' : ' [<] ' :
> *input Ans
>
>   begin case
>         case Lock.Test =  0   ;                recordlocku F.This.File,
> Record.ID
>                                 write R.This          on F.This.File,
> Record.ID
>                                                  release F.This.File,
> Record.ID
>
>         case 1                    ;  gosub Error.Record.Locking
>   end   case
>
> return
>
>
*---------------------------------------------------------------------------
> ---
> Error.Opening.File:
>
>   crt @(-1)
>   crt @(-5)
>
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt '      Big Problem...                                ' : @(-6)
>   crt
>   crt ' _________________________                          '
>   crt ' \                        \      ' : This.File
>   crt '  \   Error Opening File   \                        '
>   crt '   \________________________\    Contact HK.IT      '
>   crt '                                               [X]  '
>   crt '                                                '   :
>
>   input Ans, 1
>         Ans  = upcase(Ans)
>
>   begin case
>         case Ans = 'X'  ;  null
>       case 1          ;  go Error.Opening.File
>   end   case
>
> return to The.End
>
>
*---------------------------------------------------------------------------
> ---
> Error.Record.Locking:
>
>   crt @(-1)
>   crt @(-5)
>
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt
>   crt '      Big Problem...                                ' : @(-6)
>   crt
>   crt ' _________________________                          '
>   crt ' \                        \      ' : This.File
>   crt '  \   Error, Record Lock   \                        '
>   crt '   \________________________\    Contact HK.IT      '
>   crt
>   crt '                                 Open New Gull Session, Try
UNLOCK.ME
> '
>   crt '
> [X]  '
>   crt '
> '   :
>
>   input Ans, 1
>         Ans  = upcase(Ans)
>
>   begin case
>         case Ans = 'X'  ;  null
>       case 1          ;  go Error.Record.Locking
>   end   case
>
> return to The.End
>
>
*---------------------------------------------------------------------------
> ---
> The.End:
>
>   RETURN
>   END
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of David Wolverton
> Sent: Thursday, April 24, 2008 9:59 AM
> To: [email protected]
> Subject: RE: [U2] Guaranteed unique sequential keys
>
>
> And on this part ...
>
> > potentially give me the wrong sequence should two events
> > occur within the same millisecond (unless it is ruled out
> > that this is not possible).
>
> I was only partially kidding about the 'two items a second' thing -- even
if
> this were NOT possible today, in the lifetime of your software, you must
> plan on this being a reality with the next piece of hardware you get...
>
> I know of several programs we had to 'touch' once we started having
> 'overwrites' of data due to using a Date/TimeInSeconds stamp *way* back in
> the 80s.
>
> DW
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/

_________________________________________________________________
Spell a grand slam in this game where word skill meets World Series. Get in
the game.
http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to