Sunday 15 August 2010

Mysql prevent select on a table while executing a trigger -


I need to populate a MySQL table with the trigger. I read it from a table and copy data to each other It's triggered: Delete

DEFINER = root @ host operation create () BEGIN; Put in Opent * Choose from Open 2 where open = 1; END $$ DELIMITER;

It happened that another process tried to select * rows from the table and how can I stop other queries to select the table when this empty triangle is executed?

I try to better understand that I have many clients who are connected to the table with only one selection, then a php page that chooses all the records from Table A. Table A is created by a trigger that copies the data from table to table after updating some records. The problem is that when the trigger works, then it will have to delete all the rows from the table row and insert it again. If php is said in that time, then it gets a partial table. I really do not know where to use the table lock, using the selection for the trigger or updates to the PHP page?

You should read the locking, see the document here:

Although it's time to Depending on it, even if you lock the table, it seems that there is still a window where it is not yet present.


No comments:

Post a Comment