[Tutor] Persistent store for a single integer

Deirdre Saoirse deirdre@deirdre.net
Sat, 5 Feb 2000 15:44:22 -0800 (PST)

On Thu, 3 Feb 2000, Patrick Phalen wrote:

> The Unique ID is an integer starting at 1000000 and incrementing by 1
> for each new "customer."
> So, in other words, when I write the data to the file, I need to
> determine the last-used integer, increment it and concatenate this
> UniqueID to most of the fields.
> What is a good persistence model for this integer? A file with a
> mutex/lock? A pickled numeral? These seem kind of expensive.

Actually, I typically use Gadfly (www.chordate.com) for this kind of
thing, especially with my sequence number additions.

> Naturally, I want to avoid data corruption in the case where many people
> might access the form at once, take arbitrary time to complete the
> form, etc., without blocking people for lengthy periods.

_Deirdre   *   http://www.linuxcabal.net   *   http://www.deirdre.net
"Mars has been a tough target" -- Peter G. Neumann, Risks Digest Moderator
"That's because the Martians keep shooting things down." -- Harlan Rosenthal
<Harlan.Rosenthal@Dialogic.com>, retorting in Risks Digest 20.60