Quantcast
Channel: OPC Labs - OPC Labs - Recent Topics - OPC Labs Online Forums
Viewing all articles
Browse latest Browse all 1794

parallel execution of mapping - by: Captain_Dash

$
0
0
Hello,

I discovered a strange behavior of the mapping class and wanted to know whether it is caused by the client or the server and how to avoid it properly.

First of all we have a class which contains a class that will be mapped to a structure on the server. Of this class we have multiple instances and start parallel execution of a init method where the mapping will be done. When the map method is executed a exception will be thrown. Either this Exception is a NullReferenceException or an ArgumentException. The ArgumentException provide the following message:
An exception of type 'System.ArgumentException' occurred in OpcLabs.BaseLib.dll but was not handled in user code

Additional information: Mapping definition for a type 'XXXTYPEXXX' already exists in the abstract mapping provider.

If I am using a lock around the map method everything is working fine. But in that way it is necessary to know if any other class which uses the mapping will call the method.

I extracted this problem in a little Example:

Example class:


Usage of the class:



Best Regards
André

Viewing all articles
Browse latest Browse all 1794