Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

BB Re: using perl to lock tables without locking myself

by knobunc (Pilgrim)
on Mar 13, 2002 at 17:48 UTC ( #151462=note: print w/ replies, xml ) Need Help??

in reply to using perl to lock tables without locking myself

Rather than lock the whole table you might be able to use SELECT ... FOR UPDATE to only lock the rows you are about to change. Although that is usually only necessary if you need to select data then munge it before writing it back to the table. I assume that the above code is not complete (I am guessing at that because you have stray parentheses and your prepare statement is preparing the string "SQLCommand" not the variable $SQLCommand). Since all you are doing is an update which should not have any concurrency problems.

Note that SELECT ... FOR UPDATE requires a halfway competent DB, namely one that supports transactions.


  • Comment on BB Re: using perl to lock tables without locking myself

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2016-07-01 11:21 GMT
Find Nodes?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...

    Results (410 votes). Check out past polls.