Re: checking if text has changed
- From: Duane Arnold <""Yep-Don't-Bother\"@You-got-it-right@.BET">
- Date: Wed, 19 Apr 2006 00:21:26 GMT
austinmanic@xxxxxxxxxxxxx wrote:
have app that allows users to change text. this text is stored in a
clob (db2 database).
usually, when users change any column attribute, i qualify the update
sql with the
old value in the where clause, like update table1 where id = 123 and
column1 = old_value.
if the sql didn't return any rows, then i know that somebody change the
value while
the user is changing it.
how can my app detect if some other user has changed the text while
another
user maybe changing it?
can i use the same strategy described above when dealing with clobs?
is there a better way?
Why wouldn't you use something like a user-id and datetime stamp fields? When the record is first read you hold these values in memory. When the user tries the save the data, you read the record again and compare what's held in memory against what was just read.
If they are not the same then someone has updated the record before the user could save the record, you would not allow the update and display a message that the data has changed.
The user must pull the record back to the screen and update that version. Otherwise, if the user-id and datetime stamp fields are the same, then you can allow the update of the record.
I have used that method for preventing record concurrency issues. I have also just held the entire record and did the same thing by comparing the entire record to what was held in memory, but that was using CICS and Temporary Storage queue per user.
Duane :)
.
- Follow-Ups:
- Re: checking if text has changed
- From: ArkGunSlinger
- Re: checking if text has changed
- References:
- checking if text has changed
- From: austinmanic
- checking if text has changed
- Prev by Date: Re: dynamic structure for storing/querying intervals
- Next by Date: Re: Understanding soundex
- Previous by thread: checking if text has changed
- Next by thread: Re: checking if text has changed
- Index(es):
Relevant Pages
|