Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CDatabase thread safety

Tags:

c++

database

mfc

I am using CDatabase to establish connection with a ODBC database. My concerns are

Are operations on CDatabase and related classes thread safe?

one of threads will open a connection (using OpenEx) on program stratup and then other threads will perform CRUD database operations. Will thiswork fine without any threading issues

Where could I get more information on this?

like image 766
Maanu Avatar asked Apr 15 '26 19:04

Maanu


1 Answers

Operations on CDatabase are not fully thread safe, and CRecordset even less. Each thread should use it's own instance of a CRecordset object.

http://msdn.microsoft.com/en-us/library/xx6t3y0x.aspx

like image 158
dalle Avatar answered Apr 18 '26 09:04

dalle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!