Martin,

I just wouldn't do it that way: generating excess calls to the database.

Far better to call a subroutine, pass it the name of the file for which you are
generating the key, and have that handle the locking and eventual id retrieval. In that
way a) you can test the routine from the server to make sure it works and then b) all
looping and waiting is handled on the server.

Brian

On Tue, 22 Jun 2004 08:53:19 -0400
 "Martin Scholl" <[EMAIL PROTECTED]> wrote:
>I use a LAST.ID item in the file dictionary to manage ID creation.  The lock
>that I place on this record while I increase the ID does not work.
>
>gcolFiles(pstrFileName).RecordID = "LAST.ID"
>10: gcolFiles(pstrFileName).Read
>    If gcolFiles(pstrFileName).Error = UVE_NOERROR Then
>        gcolFiles(pstrFileName).LockRecord EXCLUSIVE_UPDATE
>        bla-bla
>    ElseIf gcolFiles(pstrFileName).Error = UVE_RNF Then
>        Set pitemLastID = New UniDynArray
>        bla-bla
>    ElseIf gcolFiles(pstrFileName).Error = UVE_LCK Then
>            Sleep 5
>            GoTo 10
>    End If
>
>
>If I have multiple instances of my executable running, the lock does not
>work and I end up with overwriting records which is real bad. Do read locks
>not work with dictionries? Or does anybody have another suggestion?
>Martin Scholl
>President HIPAAsuite
>18910 New Hampshire Ave
>Brinklow, MD 20862
>301-924-5537  Phone
>301-570-0139  Fax
>301-613-9572  Cell
>-------
>u2-users mailing list
>[EMAIL PROTECTED]
>To unsubscribe please visit http://listserver.u2ug.org/
>
>________________________________________________________________________
>This email was checked by MessageLabs SkyScan before entering Microgen.


________________________________________________________________________
This email was checked on leaving Microgen for viruses, similar
malicious code and inappropriate content by MessageLabs SkyScan.

DISCLAIMER

This email and any attachments are confidential and may also be
privileged.

If you are not the named recipient, please notify the sender
immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information.

In the event of any technical difficulty with this email, please
contact the sender or [EMAIL PROTECTED]

Microgen Information Management Solutions
http://www.microgen.co.uk
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to