From: Georgios P. <pet...@ya...> - 2016-09-02 11:26:06
|
On 2/9/2016 14:11, to...@tu... wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Fri, Sep 02, 2016 at 01:36:36PM +0300, Georgios Petasis wrote: >> On 2/9/2016 12:51, to...@tu... wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> On Fri, Sep 02, 2016 at 12:20:27PM +0300, Georgios Petasis wrote: >>>> Hi all, >>>> >>>> I want to use a mysql database from multiple threads [...] >>> Sorry, not really specific to tdbc, but from what I know about other >>> similar interfaces: the database connection has a state [...] >> Since I have a new connection per thread, I was expecting that begin >> transaction/commit will be particular to each thread. However, they seem >> to interfere, and mysql client gets confused. Or I am using tdbc::mysql >> the wrong way. > Ah, ok. Then, most of what i've written is moot :-) > > Given what you write, it might be some part of tdbc (perhaps the *dbc > library?) isn't thread safe? > > A (admittedly superficial) net search didn't turn up relevant stuff for > me, though. > To say the truth, I am not sure there is a problem in the tdbc mysql driver. I have just a quick look in the code, and as soon as mysql_library_init() is called once, and then if mysql_init() is called on each thread, everything should be ok (according to the manual: https://dev.mysql.com/doc/refman/5.7/en/c-api-threaded-clients.html). Regards, George|| <https://dev.mysql.com/doc/refman/5.7/en/mysql-library-init.html> |