> database row locks from one request (query of information to
> display in a HTML form) to the next (updating the
> information)? Data integrity is the concern of course...how
> to keep two users from updating the same record from the
> database at the same time.
>
> I've been trying to use SELECT...FOR UPDATE without any success.
Practically speaking, you can't successfully retain database locks across
multiple requests - and even if you could, it would be a bad idea. What
happens if the second request never comes - would you want the lock to
persist indefinitely?
Instead, to ensure data integrity, you have to write additional code to
manage the editing process. This can be pretty simple, actually. For
example, you can use a timestamp field to track when the record was last
updated, and only allow an edit to succeed if the timestamp field hasn't
changed since the record was selected for editing.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

