Page 1 of 1

Searching for MyConnection thread collision solution

Posted: Sun 14 Oct 2012 23:49
by pigman
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:

Re: Searching for MyConnection thread collision solution

Posted: Mon 15 Oct 2012 07:39
by AndreyZ
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.