Daniel Kolbo wrote:

When a MySQL table is locked a php call of mysql_query() that requires
that table will hang as the request blocks at the MySQL server until the
table is unlocked.  Is there a way to stop a mysql_query from hanging
(by setting a time limit)?

I can understand you asking the question here, but I suspect that the answer may come better from a list who has people who are more expert in MySQL?

Personally - with Firebird - this is not a problem that ever arises since 'locking' is not something one would normally do and has only appeared IN Firebird because people 'expect' that is how a database works. Even if using it would actually be wrong :) The problem is that the database is the problem rather than PHP, hence the questions about which type of tables you are using in MySQL.

From my personal experience, it's the way that you are using the database that may be wrong if it relies on 'locking' to achieve something that is not properly managed IN the database. Any database can provide 'locking', if that is really required, by additional flagging in the database - if the database itself does not provide the function properly. Such as setting an 'edit' flag on a record showing who is changing it, which can then be used to advise that fact to other users.

Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to