Searching for MyConnection thread collision solution

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
pigman
Posts: 1
Joined: Wed 16 May 2012 23:00

Searching for MyConnection thread collision solution

Post by pigman » Sun 14 Oct 2012 23:49

For fast MySQL transaction speeds, I keep a MyConnection open at all times once my application starts but now I'm having problems due to accessing the same MyConnection with different threads. What are some solutions for this? Should I open and close the MyConnection after each set of transactions or should I set "connected" to false? I would think that opening and closing the TMyConnection would cause significant execution delays so I'm curios how other people handle this.
Thank you. :mrgreen:

AndreyZ

Re: Searching for MyConnection thread collision solution

Post by AndreyZ » Mon 15 Oct 2012 07:39

MyDAC is thread-safe, but the restriction is that you cannot use one connection (the TMyConnection component) in several threads, you must have a connection in each thread.

Post Reply