4

I am currently using SQL Server CE 4.0 and accessing the database using the ATL OLEDB C++ API.

I am using a shared connection (CDataSource object) across threads with a separate CSession object per thread.

In my queries, I am providing table lock hints to push the concurrency management away from my application and onto SQL CE.

I have read that in general, SQL Server CE connections are not thread safe - but is that true when accessing the database from the ATL OLEDB API? My understanding is that OLEDB is thread-safe.

As long as I use short lived CSession and CCommand objects each per thread, I have not encountered any weird behavior due to potential concurrency issues.

So would it be safe to assume that this usage model is safe from a concurrency point of vied or am I missing something?

rohitsan
  • 1,001
  • 8
  • 31

0 Answers0