Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2018-01-23 14:11 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (247 votes). Check out past polls.