Locking Question

TomBascom

Curmudgeon
hi i dont know if its right to interfere to another thread but i cant find any same thread about my problem . . .

No, it is not right to hijack an old thread for a new purpose.

this is the only thread i found that is very similar to what my problem is . . .

That's odd because I've seen this text in two hijacked threads so far :rolleyes:

i am working on a company who develop banking system . . . i have a problem also about record locking and it involves updating the same database simultaneosly . . . . weve created many module on our system and when my problem is when the system will be use there are many programs will run simultaneosly and access the data simultaneosly also. . and it will also update the database by many programs i wolud like to know what will be the effect if all the program will access the same table and update it also . . we have a field on the table that will save all the transaction sequence made by the system and all of the module will access and update it also . . what if one module uses the table and other also will use it. . . on our query we use no-lock when we will access only the table but when we will update it or create record we use exclusive lock . . . i know that if someone is using that table the other transaction will just wait until the record is not lock . . . please help me what will be the most posible solution on my problem . . . tanx very much . . . . and im a newbie on this site tanx . . .

I think that you are asking about what happens if multiple users attempt to update the same record at the same time from different workstations?

It depends. To really explain this probably takes at least an hour long presentation. A lot depends on whether you want to implement a pessimistic or an optimistic locking strategy. (Hint: rookie programmers tend to prefer pessimistic, end users tend to prefer optimistic -- guess who usually wins in the long run...) Progress supports both.

If it is literally at the same time then only one might successfully obtain an exclusive-lock and update the record. The others will get errors and whatever error handling your application has will kick in -- if you have no error handling then the users will get nasty and probably confusing messages from Progress.

It is possible, especially if you are using share-locks, that no user will be able to get the exclusive-lock. Everyone will get an error when they attempt to upgrade the lock because other users have share-locks.

One way to get comfortable with all of this is to run some tests -- start the sports database, open a couple of windows and try out some sample code that reads, locks and updates records.
 
Top