• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table Locks

 
Gavin Tranter
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Not sure if this question is one I should be asking here, if not, I am sorry.

I am using mySQL (5.0.37) an am using a stored function to implement Oracle like sequence numbers.

I am having a little issue with the update.
So I was wondering if the use of BEGIN creates a lock on the table at the start of the stored function, so that while the function is executing no other function can update the sequence table.

I think this might be wishful thinking because it dosnt know what table I am trying to work with until it encounters the update

I will continue searching mySQL and if I find any answers will post them back here for the record.

thanks
G
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gavin,
This is the right place to ask your question.

I'm pretty sure you don't get a lock until the actual update statement. Also, note that some databases don't lock the whole table, just the row you are using. This probably isn't a problem for your table though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic