• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Table Locks

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
this is supposed to be a surprise, but it smells like a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic