Product: TIBCO Spotfire®
Loading the Custom Data Source on the Application Thread.
Certain operations (for example : fetching custom preferences) in the CustomDataSource class gives an exception "Attempt to perform an operation on an incorrect thread. Use ApplicationThread.Invoke() to invoke into the application thread."
For such operations resulting in the above exception indicates that the data source should be loaded on the application thread.
- In Spotfire 10.10 there is an API property "AlwaysLoadOnApplicationThread" in the CustomDataSource class that each implementer can override to load the data source on the application thread.
- CustomDataSource.AlwaysLoadOnApplicationThread property.
- Note that setting the preference in the Administration Manager “LoadDataFromCustomDataSourcesOnApplicationThread” also makes it achievable. However setting this preference does affect all custom data sources(which may not be a requirement and in turn affect those) and needs manual intervention to do it.
- With the API capability there isn't any need to set the Preference at the central level in the Administration Manager. The AlwaysLoadOnApplicationThread property can be set to true(default is false) at the code level as per the use case.