P,

I usually use an update counter for our web-apps.  Every time a record is 
updated
a trigger bumps up the update count and sets a userid.  If the new record image
update count does not match the presented update count, then a message is
returned stating who updated the record.

If you are concerned about exactly what was updated, you have to pass the record
image and compare it to the current record image before an update is performed.
I do this via a database wrapper/trigger combination. It does effectively 
double the
amount of data passed to an update and forces a potentially large compare.

David Morris



>>> P.Goovaerts@Clipper.Be 10/08/01 07:41AM >>>
I have a webapp which allows a user to retrieve a record from our
AS400 using SQL 'and prepared statements'. I also can write / update
records in the database.
How do I handle 'record-locking'? As an RPG-programmer, I was lucky
that this is done by the AS400 itself.

Sure, I can add a statusfield 'locked Y/N'
- which can be changed to 'Y' when record is read
- which can be changed to 'N' when record is updated/deleted
But... when user reads a record (locked = 'y')
1) he can close the browser without doing the update...
2) he can keep the session open without doing anything...
3) the connection can be lost...
4) servlet-programming error can occur...

please advice...



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.