Problem with MySQL and lock conflict management

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Problem with MySQL and lock conflict management

Post by bangkok » Mon Apr 25, 2011 4:52 pm

-newly installed standard windows MySQL 5.1

-i lock a record with my SQL editor (Heidi) on a InnoDB table : "begin;update XX set YY=1 where ZZ=1" (without commit)

-on LiveCode : i connect to the same DB, and i do a simple :
revExecuteSQL dbIDM, "update XX set YY=1 where ZZ=1"

LiveCode freeze for 20 seconds and then I receive an error message "Lost connection to MySQL server during query".

I tried the other way around (the begin + update without commit on LiveCode) and then a simple update within HeidiSQL : then HeidiSQL freezes, and a few seconds after, I got an error message : "SQL Error 1205 : lock wait timeout exceeded; try restarting transaction"

What's the point to freeze like that ? If a record is locked, why I can't have a proper negative feedback, so I can issue a rollback or warn the user ?

Or do i miss the whole thing ?

Furthermore : I can't issue the rollback on livecode, if the connection is lost ?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem with MySQL and lock conflict management

Post by Mark » Mon May 09, 2011 2:48 pm

Hi Bangkok,

You can't execute multiple MySQL statements in LiveCode. Syntax like "begin; update..." is impossible. Therefore, I don't think you can do this at all from within LiveCode. You might want to use PHP as an intermediate.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply