Click here to Skip to main content
15,888,157 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a doubt.

In my application (web application), when user click on the save button I need to update records in 5 table , during this process other users should not allow to update records in the same 5 tables.

Once the first user completed the process next user can proceed

my question is it require to implement multi threading?
Posted

You should use Transaction or Lock in your database.
Can study these links about
Transaction and Lock.

Best Regard,
Theingi Win
 
Share this answer
 
Comments
Sridhar Patnayak 21-Mar-11 3:51am    
Theingi
I think it is not posible, because if we maintain lock then while updating records
if connection failed, lock will not update, so that another process does not enter
Are you sure that other people cannot modify the same tables or the same rows?

Typically this requirement is defined on row level and this is taken care by the dbms which uses locks to prevent simultaneous modifications on the same rows.

So as Theingi Win already pointed out, as a programmer you're responsible in wrapping all the necessary DML (insert, update...) operations into a single transaction.
 
Share this answer
 
"my question is it require to implement multi threading?"

No.
"Please describe me in detail"

No, it is not required to implement multi threading in order to update records in 5 tables.

Is that detailed enough for you?
 
Share this answer
 
v2
Comments
Sridhar Patnayak 21-Mar-11 3:51am    
Please describe me in detail
OriginalGriff 21-Mar-11 4:08am    
Answer updated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900