MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help
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.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 12th, 2001, 03:13 AM
tim snl's Avatar
tim snl tim snl is offline
Code Cruncher
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Tasmania, Australia
Posts: 121 tim snl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 48 m 34 sec
Reputation Power: 11
Question

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!

Reply With Quote
  #2  
Old April 12th, 2001, 09:49 AM
sr sr is offline
Problem Solver
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2001
Location: Stockholm, Sweden
Posts: 4,284 sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)sr User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 7 h 23 m 13 sec
Reputation Power: 448
I think what you are looking for is:
GET_LOCK(string,timeout)
RELEASE_LOCK(string)

Quote from manual:
Quote:
This function can be used to implement application locks or to simulate record locks.


Cheers
__________________
/Stefan

Reply With Quote
  #3  
Old April 16th, 2001, 05:12 PM
tim snl's Avatar
tim snl tim snl is offline
Code Cruncher
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Tasmania, Australia
Posts: 121 tim snl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

So ... I keep looking, any other suggestions?

Tim

Reply With Quote
  #4  
Old April 16th, 2001, 07:28 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Unhappy

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Record Locking


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap