This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Table Locks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Table Locks" Watch "Table Locks" New topic
Author

Table Locks

Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Table Locks
 
Similar Threads
JPA and MySQL Stored Procedure
Primary Key Autogeneration for InheritenceType. TABLE_PER_CLASS
Link IDs on Page
Using non-qualified column reference Error
log function in jsf