I'm currently looking at a problem we are having in a .Net Framework 2.0 windows service (C#) that has X number of MTA threads running that access COM components. Each thread initializes it's own instance of the com component object. The com component object does not have any UI elements. It's simply business logic that communicates with a sql server database and a C# dll with a com interface that in turn does socket communication and access to the same sql server database.
Through my research I've found that you should not be instantiating STA COM components on an MTA thread but I can't find any specific text to say what the dangers of this are or maybe it's the fact I don't understand COM threading apartments that well.
Would there be concurrency problems with the model being described above? Even if each MTA thread is creating it's own STA COM object?
Edit
The problem we are actually running into is an object reference not set to instance of an object error in the setter of the connection string in following code block. This occurs within the C# COM object that is called by the c++ COM object:
IDbConnection connection;
//Code omitted for brevity where connection is initialized
connection.ConnectionString = myConnectionString;
Exception Type: System.NullReferenceException Message: Object reference not set to an instance of an object. Data: System.Collections.ListDictionaryInternal TargetSite: Void ConnectionString_Set(System.String) at System.Data.OracleClient.OracleConnection.ConnectionString_Set(String value) at System.Data.OracleClient.OracleConnection.set_ConnectionString(String value)