Hi there,
My program accesses an InnoDB database. I sometimes have to lock a table for a quite long time (10 seconds or so) to update, where I also forbid reading the table with a LOCK TABLE ... WRITE.
When other users then try to access this table I don't want the program to be blocked for 10 seconds waiting for the lock to be released. I'm thinking of a nice little message box such as "please wait while another user performs critical updates" or something. But how can I detect if the table is locked?
I read the following thread,
thread436-520964,
but I don't want to give all my users the SUPER privilege so that they see all running threads using SHOW FULL PROCESSLIST. Anyway, this command can only show me if the table is locked WHILE the thread issues LOCK TABLE .. WRITE, can't it?
What could I do? Is it the only solution to create another table that contains
TABLENAME string,
LOCKED tinyint unsigned
where LOCKED>0 if the table has been locked?
Thanks a lot,
Anne
My program accesses an InnoDB database. I sometimes have to lock a table for a quite long time (10 seconds or so) to update, where I also forbid reading the table with a LOCK TABLE ... WRITE.
When other users then try to access this table I don't want the program to be blocked for 10 seconds waiting for the lock to be released. I'm thinking of a nice little message box such as "please wait while another user performs critical updates" or something. But how can I detect if the table is locked?
I read the following thread,
thread436-520964,
but I don't want to give all my users the SUPER privilege so that they see all running threads using SHOW FULL PROCESSLIST. Anyway, this command can only show me if the table is locked WHILE the thread issues LOCK TABLE .. WRITE, can't it?
What could I do? Is it the only solution to create another table that contains
TABLENAME string,
LOCKED tinyint unsigned
where LOCKED>0 if the table has been locked?
Thanks a lot,
Anne