Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In web, multi-user scenario, I have a work registration form where a unique workId is generated. If multi-users hit for the same reg. form how to handle transaction ?? means how to put database lock for it.

If i put database lock on a table for inserts it may work.

But if a user does an update on that table and if another does an update on that table then how ???

Pls have a solution for this ?
Posted
Updated 27-Mar-11 20:54pm
v2
Comments
Eduard Keilholz 28-Mar-11 2:54am    
Updated question style... (removed code block)

1 solution

Why not just make the WorkID either autoincremented (nasty) and let the database itself ensure the uniqueness, or a GUID, and then the laws of probability ensure uniqueness? I would use GUIDs, myself.
 
Share this answer
 

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