<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for PowerPoint 97">
<TITLE>Web DBI - Concurrent editing</TITLE>
</HEAD>
<BODY >
<H1>Web DBI - Concurrent editing</H1>
<P><UL>
<LI><H2>How to prevent updates overwriting each other?
</H2>
<UL>
<LI>You can use Optimistic Locking via 'qualified update':
<UL>
update table set ...
<BR><BR>where key = $old_key
<BR>and field1 = $old_field1
<BR>and field2 = $old_field2 and
for all other fields
</UL></UL></UL><UL>
<LI><H2>Check the update row count
</H2>
<UL>
<LI>If it's zero then you know the record has been changed or deleted by another process
</UL></UL><UL>
<LI><H2>Note
</H2>
<UL>
<LI>Potential problems with floating point data values not matching due to rounding
<LI>Some databases support a high-resolution 'update timestamp' field that can be checked instead</UL></UL></P>
<P></P>
<P>
<TABLE>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld059.htm">Previous slide</A> </TD>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld061.htm">Next slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="tsld001.htm">Back to first slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="sld060.htm">View graphic version</A> </TD>
</TABLE>
<BR>
</P>
</Body>
</HTML>