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
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
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 

"'Java Programming on and around the iSeries / AS400'" 

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.


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

This thread ...


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