Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2PL - how do i cope with multi users

Status
Not open for further replies.

excession

Programmer
Sep 22, 2004
111
GB
How do you deal with multiple users accessing a mySQL database through php? I've a web based system that allows users to access and edit a database, at present there would only ever be one person using the system but that is about to change and I've no idea how to prevent dirty read/writes.
 
ok, I know that, but if I want the system to allow a second user to have say only read permissions if the entry is currently in use?

Do I have to lock the whole table (and any related tables) or can i simply lock a row and it's related data?
 
That all depends on what table types you are using, and how much overhead you are willing to use. From what I know there are three types of locks:

Table Lock: least overhead (MyISAM, Heap, Merge storage engines)
Page Lock: slightly more overhead (BDB storage engine [uses 8-KB pages])
Row Lock: most overhead (available in InnoDB storage engine)


Hope hope this helps,
Itshim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top