We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Formula calculations concurrently for the same workbook in multi-threadsIssue with private code

Is it possible to get more information about exception:

com.aspose.cells.CellsException: Circular references("Based on cell "Лист1!A5)
	at com.aspose.cells.zada.c(Unknown Source)
	at com.aspose.cells.zada.c(Unknown Source)
	at com.aspose.cells.zaeb.b(Unknown Source)
	at com.aspose.cells.Workbook.calculateFormula(Unknown Source)

for file, when A5 is simple cell.error-2020_08_24_16_45_15.zip (11.9 KB)

Unfortunately i unable to send test case, because there is fluid bug, reasone of that i try to find.

Best regards. Alexey

@makarovalv,

I tried the following simplest sample code with your file and it works fine:
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\error-2020_08_24_16_45_15.xlsx");
		workbook.calculateFormula();

The error simply suggests, the underlying formula has some issue/corrupted or Aspose.Cells could not calculate the formula(s) properly. But still we are not sure about it as the error has many applications and scenarios. I am afraid, without a test case, we might not evaluate your issue precisely. Please do the needful and provide us the test case, so we could evaluate your issue on our end.

Hi.

Yes. If i run calculateFormula on this workbook, i not recieve exception. I have got exception, when this book calculates on out server with any another manipulations. So i request for some way to make exception little bit clear for understand.
Also i have question about concurrency on Workbook - is it threadsafe? Probably i have some trouble with multithreading.

Best regards. Alexey

@makarovalv,

As I told you that Circular references exception has many scenarios so we might not provide complete details. Anyways, we will still check if we could provide further details on the excretion.

For your information, Aspose.Cells is written in pure Java, so , concurrency and multithreading should not be a problem by any means. Our several users do use the component in their diverse environments in different types of (desktop, client server etc.) solutions or other scenarios without any problem. As long as you don’t have shared data source and every time a user access the application a new Workbook or Excel file is generated, there would be no problem at all. However, if you have a shared data/resource, then you will have to do synchronization by yourself. Also, in that case, we recommend you to create/manipulate of filling data into different workbooks in different threads accordingly, because, you should not use one workbook/file in multiple threads at the same time least you would not get stable data due to restrictions and complexity (involved) put forth by MS Excel file format(s) itself.

@makarovalv,
For your issue, maybe you are invoking calculateformula concurrently for the same workbook in multi-threads. If so, it is possible to get such kind of exception. You should use one workbook object in single thread or synchronize all operations for the same workbook object in multi-threads.