Re: checking if text has changed



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 :)



.



Relevant Pages

  • Re: FTS Performance in SQL 2005
    ... Looking for a SQL Server replication book? ... The Memory Usage and VM Size never increase over about 65 MB and 20MB. ... Can you post you query plans and the output of statistics IO ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: SBS 2003 SP2 Memory
    ... MY PF is up to 4.75GB and free Physical memory is at 1.8GB. ... about the SQL instances and watching their individual need over time. ... part if your server rarely uses the pagefile. ... each of them based on usage so watch their RAM usage for a week or more and ...
    (microsoft.public.windows.server.sbs)
  • Re: SQL .mdf privacy violation - huge file contains personal contents
    ... The .NET runtime handles memory management ... ... in memory, archived to disk, but never deleted. ... them into temp files, which again, would be a privacy violation. ... SQL Server pre-allocates space for transaction logs, fill-space, etc. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Do I need to run SQL services
    ... Thanks for using the SBS newsgroup! ... high memory usage and especially the SQL service take up much memory. ... particular server installation. ...
    (microsoft.public.windows.server.sbs)
  • Re: AWE settings.
    ... dynamic AWE to work using SQL 2005, but don't quote me on that. ... Microsoft SQL Server MVP ... immediately allocates memory at system startup. ...
    (microsoft.public.sqlserver.setup)