Do the following commands, when run from an already-established connection, actually have any bearing on anything?

SET SESSION wait_timeout=10;
SET SESSION interactive_timeout=10;

I am working on an application using the C API that needs to lock tables while doing updates. This works fine except for in the rare case when the computer the application is running on loses connectivity while a table is locked. Normally this wouldn't be a huge deal, but I am concerned because the application will mostly be running over a wireless connection which is of course subject to loss of signal. So if one person running the application loses his signal, no one else will be able to do anything.

The problem I'm running into is this - I'm testing out this situation by running the mysql command-line client on one computer, write-locking a table, starting a select query from that table on another machine, and turning off the wireless to the first machine. The second machine continues to hang as the mysql server doesn't kill the connection to the first machine and thus its lock is still in effect.

Now I believe that wait_timeout and/or interactive_timeout are what I need to help me out by killing such dead threads and thus setting a maximum time that others could hang. This is all well and great, but I am not the admin of the server, so I can't set them globally and the default values of 8 hours are obviously unreasonable for me. In the testing sequence described above, I tried running

SET SESSION wait_timeout=10;
SET SESSION interactive_timeout=10;

on the first machine before acquiring the lock and turning off wireless, but it seemed to have no effect as the second machine continued to hang for the seven minutes I let it sit. After setting the session variables I tried checking them with a select statement, and they showed 10 seconds like they should. It just seems like the server doesn't actually honor them.

Is there a problem with the server here, or am I just misunderstanding the way session variables are intended to work? Or is the way I am simulating this case flawed? I must say that the documentation is not very verbose about server variables and so wasn't extremely helpful to me in solving this problem.

If there's another better way to solve my locking issue, I would love to hear that as well.

Thanks,
        Aaron Jacobs
        [EMAIL PROTECTED]


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to