Nate Lowrie wrote: > On Feb 16, 2008 3:31 PM, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Some places they call this "optimistic locking". >> >> User A loads a record into a form and goes to lunch. User B loads the >> same record, makes changes, and saves it. User A comes back, types stuff >> into that (now stale) record and saves it. Boom, crash, death and mayhem. >> >> Does Dabo have anything built-in to avoid the "simultaneous, >> incompatible edits" problem? >> >> I've seen this typically handled by having an 'edit_sequence' field on >> every table that holds a unique non null sequence value that gets >> automatically incremented with every update. And every update must first >> check to see if it's stored edit_sequence value matches the one in the >> database. If not, it must go back to the user with a very unwelcome >> message like "That idiot down the hall edited the record you were >> working on so now you have to start over. Sorry." And reload the >> refreshed record. >> >> Does Dabo have anything built-in? > > Dabo does not have anything built into to. But, you should be able to > roll your own pretty easily. > > I have found that this isn't really a problem though for small > businesses. The chances of two people modifying an identical record > at the same time are pretty slim. > > The other thing that you might be able to get away with is some form > of semaphore locking...Have a table that has one field, a integer > field with the customer ID. Then, when the program wants to edit the > customer they add a row to the database containing the customer id. > If another user wants to change the customer data, the program will > check the lock table for the customer row they want to edit. If the > row is in the lock table, they can't edit it because it is being > edited. When the program is done editing the particular filed it will > delete the entry in the lock field so that other
I didn't build anything like this into my application the first time out and definitely regretted it. I heard lots of "I know I changed this! I'm sure I changed it!" Some detective work found several incidents per day of one user overwriting another's changes. Very perplexing at first. I'm trying to stay away from any form of locking so I probably can't use your idea this time. But it's a good one worthy of keeping for later. Thanks, Michael _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]
