MySQL Forums
Forum List  »  Stored Procedures

table locks in cursor. how it works?
Posted by: Yurii Korotia
Date: September 24, 2012 02:37AM

hello devs

I want to achieve table locks in stored procedure.
I cannot predict which rows are going to be updated as query is built with prepared statement, so I need to lock tables.
In procedure we make temporary view from statement (as mysql doesn't sopport cursor on it) and run cursor on that view.

In the cursor loop I have transaction
start transaction
...
commit


My question is:
Will my tables be locked from reading and modifiying while procedure loops through cursor? And particularly on cursor from view


thanks in advance,

Yurii



Edited 2 time(s). Last edit at 09/24/2012 02:39AM by Yurii Korotia.

Options: ReplyQuote


Subject
Views
Written By
Posted
table locks in cursor. how it works?
5617
September 24, 2012 02:37AM
2162
September 28, 2012 01:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.