Piggy writes:
> hi~
> i'm trying to write a simple multithread client program on turbo linux.just to
>manipulate some tables in mysql.but i encounter a confusing problem.
> the main thread of the program is just to insert data to table A continuously which
>has an auto_increment field named ID. after each insertion, i use last_insert_id() to
>get the new ID value.
> At the same time,the main thread will create a thread occasionally when some
>conditions are met. what the new thread do is only to drop some other table B and
>then exit.
> but when the program is running, sometimes the last_insert_id() returns 0 although
>the corresponding insertion succeeded, sometimes the drop table query of the new
>thread fails,and the error message is "Error: 2013 (Lost connection to MySQL server
>during query)".
> what's wrong? i've heard something about mysqlclient_r or mysql thread_safe client
>library, do i have to use them? then how? please help
>
> please mail your reply to me: [EMAIL PROTECTED]
> thanks!
>
> P.S.
> in my program, each thread has an exclusive connection to mysql server.
>
Yes, you need to have a thread safe client.
On Windows it can be built with VC++ 6.0.
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php