Is Any Table lock.

Posted by Admin on 12-Jun-2009 04:25

Hi,

   In my application, Use delete all records of particular table and then create new records for same table.

   It works fine for single user mode, But in multiuser mode it creates problem. Since Progress provide Record level lock.

   In this case some the records, create by First user may be deleted by second user. which results inconsistent results.

   So, I need any technique to lock the  whole table, until one user is working on it.

Thanks

Vishwdeep

All Replies

Posted by kevin_saunders on 12-Jun-2009 09:17

Use a 'Logical Lock' mechanism. Create a table that records when user A is working on the table in question. Then when user B comes along the code checks to see if there is a record indicating the other user is busy. When user A is finished, delete the logical lock record.

Or create an additional field on the existing table that is usnique to each user working on the table.

Posted by Thomas Mercer-Hursh on 12-Jun-2009 10:55

If you have multiple users doing this sort of thing at the same time, why isn't it being done in a temp-table?

Posted by ChUIMonster on 13-Jun-2009 16:54

This does not sound like a very scalable design.

Posted by Admin on 15-Jun-2009 02:14

Thanks,

This was also what I was thinking.

Posted by ojfoggin on 15-Jun-2009 02:45

I may be mistaken here as I'm only fairly new to Progress but shouldn't this be done by taking a snap shot of the records you wish to edit before you start and then mess around in temp tables and then when you want to save the record again compare the snapshot to the database again before saving the changes?

i.e. find customer record.

buffer copy into tt-customer and tt-orig-customer.

change tt-customer.

compare tt-orig-customer to customer

if the same then overwrite customer with tt-customer.

if different then throw back message telling the user that someone else has made changes.

This thread is closed