04-02-2018 10:55 PM
We create an export autocad tool for WebMap by using GeoMEdia exporting autocad engine and MapServer. The legend connections are stored in library, when the service is called, the connections are loaded into a map server instance. Each legend entry is loaded, then feeded to exportToAutoCadService.
While testing we observe that the number of output features is not consistent in the same bounding box. We suspect that the autocad version could have something to do with that or the loading data for legend entry into map server is not truely completed.
Appreciate all suggestions and ideas on investigating the problems
04-03-2018 01:47 AM
if the number of exported elements only differs for different Autocad versions, and are consistent within the same Autocad version,
then the version most likely matters and it has nothing to do with LoadData. It is possible that different Autocad versions supports different element types, so something gets exported in one version and is missing in other one.
04-03-2018 11:19 PM - edited 04-03-2018 11:20 PM
Our investigation shows that the version has nothing to do with the inconsistency. We are still investigating and the event viewer shows some info about some issue with the connection and COM object
I am not sure what goes wrong here. Appreciate all ideas and suggestions
04-04-2018 01:39 AM
the error means that a COM object has been released and the .NET wrapper points to invalid memory now. If you use Marshal.ReleaseComObject somewhere in your code, make sure that it is in pair with the variable assignment. If you use Marshal.FinalReleaseComObject, then rewrite the code and never use this function.
04-06-2018 12:07 AM - edited 04-08-2018 10:06 PM
The code is working for web map 2014, 2015 and 2016 and now we test against 16.5
The tool works ok if only one request at a time or multiple requests with only one web map instance. When we do multiple requests at the same time and have multiple webmap instances, the results become inconsistent.
In our code, we use spatialfilterpipe to filter legend entry's records that belong in the input bounding box and I don't know why but the spatial filter fails occasionally. As the result of this, the output record returned is the number of instances in the input record, but no exception is thrown in the spatialfilterpipe.
I really no idea why it behaves like that. Really appreciate all insights and suggestions
04-09-2018 12:09 AM
Our experiments show that spatialfilterpipe is the one that is not working properly. What we now try to work around is to apply the spatil filter pipe for originating pipe instead of applying it later after calling load data for each legend entry.
Here is our steps:
We are not so sure that step 5 we do correctly and how to do step 6
Here is the detail of how we code it
During testing, we observe that get legend entries and legend entry's load data are not robust and need to be taken care carefully with try/block.
We originally would like to apply spatial filter after load data function of each legend entry, but it seems to fail occasionally, returning the same number records as the input.
We appreciate all suggestions and insights on these problem.
04-09-2018 06:05 AM
there are couple of potential problems in your code, but it is not clear whether they actually are the issue. For example GeoMedia objects are mostly not thread safe, but it is not clear whether you use multiple threads or not. Also try...catch block usually does not solve problems, this construct rather hide or mask them.
So I think it would be the best if you create support ticket. In this case, we would most likely ask you for a whole working sample code with data to test.
04-09-2018 02:42 PM
Thank you for looking into this problem. Would you mind pointing for us which parts of our code could be potential problem?
I am sure we are not using multiple threads. We understand that a try/catch block doesnt' solve the problem, just work around this, so we appreciate if you briefly outline how it should be approached.
As I mention, the part that we still have problem is how to use spatialfilterpipe so it should work correctly and consistently. I have no idea how it could be inconsistently when doing multiple requests. Appreciate all insights and explanations on this problem.
04-10-2018 04:02 AM
I cannot infer much more from the code snippet you provided. As I wrote before, the best would be if you create a support ticket, and then possibly provide your code the the assigned analyst.