I am a software dev at a company evaluating if Aspose.Cells is suitable for its needs.
I am inputting data, executing formulae and reading output data from an Excel file. The Excel file contains circular references, which Aspose.Cells deals with just fine. I cannot provide the Excel file as reference, because it is copyrighted.
In order to deal with simultaneous requests to the Excel file’s content, I need to concurrently access its data. To avoid the usual data corruption issues, the Excel file is read into memory as a byte array and then the byte array is being written to multiple Stream instances. For each thread the Stream instance created during the previous step is passed to the Aspose.Cells.Workbook constructor. As such, I have multiple separate Workbook instances based upon the content of the original Excel file.
The previous setup ensures complete isolation of data and object instances. However, when performing the same processing as before, but in parallel on the multiple Workbook instances, circular reference errors occur:
threw exception: System.AggregateException: One or more errors occurred. ---> Aspose.Cells.CellsException: Circular Reference for  Stack trace: at . () at Aspose.Cells.Workbook.CalculateFormula(CalculationOptions options) at Aspose.Cells.Workbook.CalculateFormula(Boolean ignoreError, ICustomFunction customFunction) at Aspose.Cells.Workbook.CalculateFormula()
These errors do not happen when processing the multiple Workbook instances sequentially, which is surprising to say the least, considering there is no shared state between Workbook instances in my application code.
Is there any shared state (static data) in the code of the class Aspose.Cells.Workflow, or, at the least, shared state in some code dealing with circular references? What else could it be that affects separate Workbook instances when used concurrently, but sequentially works without issue?
I am looking forward to hearing from you!