c - Making MySQL client program thread safe? -


i'm running interesting threadding problem while running d programming uses mysql c api. getting error 2013 "lost connection mysql server during query." problem appears occurs when enough threads flood network interface buffer, server still has more transfer. best guess based on research , running program on 2 different computers. 1 computer has 100mb connection server , other has 1gb connection. computer 100mb connection throws error, while 1gb computer not. wondering if running described in first paragraph of how write threaded client in mysql documentation. if am, need sigpipe , how do it?

for interested, calling mysql_library_init before library call , creating new mysql* each thread mysql_init , mysql_real_connect. of note, queries executing small selects, few thousand records returned each query , queries executed same table.

please try before mysql_real_connect:

my_bool myb = 1; mysql_options(conn, mysql_option.mysql_opt_reconnect, &myb); 

also please check mysql troubleshooting page: http://dev.mysql.com/doc/refman/5.5/en/gone-away.html


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -