MIDRANGE dot COM Mailing List Archive



Home » JAVA400-L » October 2005

RE: Locking records in DB2



fixed

This one sounds even easier.  I think this is the approach I will use.  We 
don't allow any 'users' to do DFU or updates to records in any way shape 
or form like that.  The only scenario that could arise, is a record 
needing to be updating in this manner by one of the IT department.  In 
that event, we usually make sure all users are out of the application 
before doing so.  Thanks for all the suggestions, I'm on my way now :)

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
709-576-8132
rpower@xxxxxxxxxx
http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




"Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx> 
Sent by: java400-l-bounces@xxxxxxxxxxxx
2005/10/05 10:36 AM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
"'Java Programming on and around the iSeries / AS400'" 
<java400-l@xxxxxxxxxxxx>
cc

Subject
RE: Locking records in DB2






There are even variations on this one, Ron.

If you have complete control over your database, you can implement a
much faster mechanism by putting a timestamp or even simple counter in
your database that is changed whenever a record is updated.  In the case
of a counter, simply save the counter when the record is read.  Reread
the counter on update and if it has changed, then go through the whole
"record has changed" logic.  Otherwise, increment the counter and update
the record.

Note that this has the possibility of wiping out changes done
"externally" (as in via DFU or ODBC).  Personally, though, I find the
idea of allowing such outside updates to the database to be a recipe for
disaster much larger than a simple record lock.  A record lock stops a
user; losing database integrity stops ALL your users.

Joe

> From: RPower@xxxxxxxxxx
> 
> I think I'll do the whole, get record, display record, user does what
they
> want, then check before update that it's the same.  Thanks all.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact