Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do I lock tables using DBI and mySQL?

by filmo (Scribe)
on Sep 11, 2001 at 09:01 UTC ( [id://111670]=note: print w/replies, xml ) Need Help??


in reply to How do I lock tables using DBI and mySQL?

Follow up question: Does the lock cover multiple statement handles? i.e.
$dbh->do("LOCK TABLES foo WRITE, bar READ"); $sth->prepare("SELECT x,y,z FROM bar"); $sth2->prepare("INSERT INTO foo SET a = ?"); while (@ary = $sth->fetchrow_array()) { $sth2->$execute($ary[0]); } $sth2->finish(); $sth->finish(); $dbh->do("UNLOCK TABLES");
Is this correct or will $sth2 not be able to access the tables because of the lock?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://111670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-16 18:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found