Clyde, ----- Original Message ----- From: ""Clyde"" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Saturday, January 04, 2003 11:47 AM Subject: How to Unlock a row?
> Hi, > > Using MySql with InnoDB files you can lock rows for update. > Eg select * from customer where cusomerID=1 for update > > I assume these locks are release when the the records selected are actually updated no. (or the connection is terminated). But how do you release these record locks if you do not want to go ahead with the update. > > Scenario: > > User selects records to update. > User changes mind (clicks on cancel button) > > Now we have locked rows that need to be unlocked. > > How to do this? InnoDB only releases row locks in COMMIT and ROLLBACK. Terminating a connection in MySQL automatically does a ROLLBACK. In your case I think a ROLLBACK is appropriate? There is no method to unlock an InnoDB row during the transaction. That feature could be added rather easily: SELECT ... FROM ... WHERE ... UNLOCK; but since such SQL commands do not exist in most other databases, I think there is little need for the feature. > Thanks > Clyde Best regards, Heikki Tuuri Innobase Oy --- Order technical MySQL/InnoDB support at https://order.mysql.com/ See http://www.innodb.com for the online manual and latest news on InnoDB --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php