Description:
i am facing issue in the mysql data pooling...i have client server architecture,
server and client are bosth acessing the same table.
lets say the table name is t1.
t1 contain pool of random numbers , the server software continually count the table t1 every 100 milliseconds and if the count is below 1k it regenerate the random numbers. the client application lock the table t1 with write lock and download set of random number and then unlock tables.
i am facing issue when client is trying to lock table the table t1 is already locked hence its keep on waiting since server is locking the table by its select count(1) query. kindly give me solution to solve this problem.
i am using the following query on server
select count(1) from t1 where status='unused';
on client :
show open tables where in_use>0;
lock table t1 write;
--download numbers
unlock tables;
my client is always stuck in state:>show open tables where in_use>0;
since the server is acessing the table and it gets always 1 records in the above query.
How to repeat:
t1 contain pool of random numbers , the server software continually count the table t1 every 100 milliseconds and if the count is below 1k it regenerate the random numbers. the client application lock the table t1 with write lock and download set of random number and then unlock tables.
i am facing issue when client is trying to lock table the table t1 is already locked hence its keep on waiting since server is locking the table by its select count(1) query. kindly give me solution to solve this problem.
i am using the following query on server
select count(1) from t1 where status='unused';
on client :
show open tables where in_use>0;
lock table t1 write;
--download numbers
unlock tables;
my client is always stuck in state:>show open tables where in_use>0;
since the server is acessing the table and it gets always 1 records in the above query