SpotFire Error : Attempt to get snapshot info of a node state of type 'DisposedDocumentNodeState'

SpotFire Error : Attempt to get snapshot info of a node state of type 'DisposedDocumentNodeState'

我们有一个 winforms 附加组件作为 SpotFire 中的可视化。在程序中,我们使用以下代码手动设置标签

Tagcolumn = table.Columns["tags"].As<TagsColumn>());

Tagcolumn.Tag("tag", rowSelection); 

执行上述代码后,当 UI 刷新以显示新标记时,SpotFire 随机抛出未处理的异常(即)它并不总是发生,我得到 5 次中的 2 次异常。

"System.InvalidOperationException was unhandled Message: An unhandled exception of type 'System.InvalidOperationException' occurred in Spotfire.Dxp.Application.dll Additional information: Attempt to get snapshot info of a node state of type 'DisposedDocumentNodeState'.

Spotfire.Dxp.Application.Calculations.TableFilterSetCalculationDependency.CheckChange.AnonymousMethod__5()"

如果我打开散点图并应用 kmeans 和线相似度,这个错误会一直发生。

有没有人知道为什么会发生这种情况以及如何在代码中处理这个错误。

在 ExecuteTransactions 中调用 Set Tag 功能可以避免下面提到的异常。在 SetTag 运行 出现在导致错误的应用程序 UI 线程中之前,运行 SeTTag 作为文档事务的一部分解决了问题,如下所示。

DataTable.Transactions.ExecuteTransactions(delegate
{
  SetTag();
});