Date Posted:
Product: TIBCO Spotfire®
Product: TIBCO Spotfire®
Problem:
Loading the Custom Data Source on the Application Thread.
Solution:
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.
- https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/html/P_Spotfire_Dxp_Application_Extension_CustomDataSource_AlwaysLoadOnApplicationThread.htm
- 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.
Comments
0 comments
Article is closed for comments.