Apply for Zend Framework Certification Training

Mysql





Row Lock In Mysql
Row locking is required when performing operation on same record

Eg  let say a company balance is to debit or credit so When somebody is 
debiting some amount in company of crediting some amount in a particular 
record in that case amount must not change for actual and at Db to 
maintain that we require locking of record.

Ways to Lock Record

1) To Only Read the record  (ie Other user can only See the Record)
SELECT * FROM table WHERE transaction_id= 2226 LOCK IN SHARE MODE 

2) Do not even read a record(ie Other user will not be able to even 
    see the record)
SELECT * FROM table WHERE transaction_id= 2226 For UPDATE       

< Mysql stored procedure Normolization in mysql Database >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top