在
Delphi
帮助文档,《
Using the main VCL thread
》我找到了下面一段话:
……
Data access components are thread-safe as long as each thread has its own database session component. The one exception to this is when you are using Access drivers. Access drivers are built using the Microsoft ADO library, which is not thread-safe.
…..
同样在 Delphi 的帮助文档《 Managing multiple sessions 》中给我明确的建议:
……
If you create a single application that uses multiple threads to perform database operations, you must create one additional session for each thread.
…..
ADO 控件是线程不安全的,所以如果你的程序是使用多线程访问数据库的话你应该确保每个线程都有自己的会话。