Discuss Record Locking in the MySQL Help forum on Dev Shed. Record Locking MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 121
Time spent in forums: 9 h 48 m 34 sec
Reputation Power: 11
Does anyone have any suggestions how to do record locking in the MySQL server. When a record is being used by a user all other users are asked to wait untill they are finished.
I have a feeling the solution will involve a table to handle the locking, storing the TABLE IN USE, RECORD ID of each record locked. If this is the way she goes, are there any suggestions as to the best way to structure this?
I am trying to use Kylix to delevop the client application
Thanks for your help.
Tim
__________________
Beware of a programmer with a screwdriver!
Posts: 121
Time spent in forums: 9 h 48 m 34 sec
Reputation Power: 11
GET_LOCK ... only 1 at a time :(
GET_LOCK is not a suitable solution because each client connection can only lock one string. "Any lock held by a client connection is automatically released ... if the client issued another GET_LOCK()", DuBois, Pg.547.
This means that if I use GET_LOCK() I can only lock one database record at a time. I will most likely need to lock many at once. The GET_LOCK() function would be perfect if only the number of locks was not limited. Does anyone know if there are any environment settings which may control this behavior.
Posts: 300
Time spent in forums: < 1 sec
Reputation Power: 12
That's one of the many things that are missing from MySQL. So far, if you want some locking inside your database, you will have to use table locks. Everything else is a hack, and, as any hack, can work or fail at the blow of the wind.
However, working with table locks is not that tough, and unless your application has to do some serious selects, like a ton of data, you should be OK with speed.