Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, February 2008
QSqlQuery::exec() function blocking when disconnecting network cable ??


Message 1 in thread

Hello,

*** Problem description :
I have a QT application running SQL requests on _one_ computer.
AND
I have a MySQL server running on _another_ computer.

When I _disconnect_ the network cable between these 2 computers, calling 
query.exec("My SQL request") will block the QT application (thus 
freezing the GUI) forever (in fact it will block it for 15 minutes, so 
there is a 15 minutes timeout somewhere !)

Please note that it only happens if I disconnect the network cable. If I 
stop the MySQL server (without disconnecting cable), the 
QSqlQuery::exec() function returns quickly as expected.


*** System Description :
QT: 3.3.8
SQL driver: I am using QSqlDatabase with QMYSQL3 driver
MySQL: 4.1.12 (also tested with > 5.x)
OS: mandriva 2008.0


*** Question :
Do you think this behavior is normal ? What are the solutions / 
workarounds to solve this problem ?

I can provide a minimalist example if necessary :-)


Thanks for your help !
						Xunile

--
 [ signature omitted ]