Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
My use case is to display how many persistence providers are connected to ThingWorx.
In my Application, using PostgreSQL and Influx DB persistent providers.
I tried using IsConnected and GetConnectivity services of persistent providers however it is returning true only.
It would be really helpful if anyone suggest some other option to check persistent provider connectivity.
Solved! Go to Solution.
In your case, there is unfortunately no real solution, influx must be started before ThingWorx.
You could create a DataTable or Stream supported by that persistence provider and do a data retrieval?
Yes, these persistence providers are being used for streams and value streams.
However sometimes Influxdb started after the Thingworx instance, and due to this services started giving the below error:
[1,018] Data store unknown error: [Error occurred while accessing the data provider.]
Hence it came as a requirement to determine which persistent providers are connected with the ThingWorx and Persistent provider services "IsConnected" & "TestConnectivity" is always returning true.
It would be helpful if you suggest some ways to determine this connectivity.
Just to clarify a few points...
1) If you start Influx before starting ThingWorx, everything works as expected?
2) At what point are you getting the "[1,018] Data store unknown error: [Error occurred while accessing the data provider.]"?
Is it when running some service dependent on this provider or just in ThingWorx startup logs?
3) If you start Influx after ThingWorx has started, things don't work as expecting (i.e. data can't be saved / read to / from Influx), despite "IsConnected" & "TestConnectivity" returning "True"?
4) Does triggeginr "ConnectDataSource" / "DisconnectDataSource" services resolve the issue, or Influx provider stays "broken" until ThingWorx restart?
5) Is the issue only Influx-related or Postgres is also affected?
1) If you start Influx before starting ThingWorx, everything works as expected?
Ans: Yes, everything works
2) At what point are you getting the "[1,018] Data store unknown error: [Error occurred while accessing the data provider.]"?
Is it when running some service dependent on this provider or just in ThingWorx startup logs?
Ans: Whenever ThingWorx gets started before the Influx DB and some service execution happened which is dependent on Influx DB persistent providers.
3) If you start Influx after ThingWorx has started, things don't work as expecting (i.e. data can't be saved / read to / from Influx), despite "IsConnected" & "TestConnectivity" returning "True"?
Ans: Yes
4) Does triggeginr "ConnectDataSource" / "DisconnectDataSource" services resolve the issue, or Influx provider stays "broken" until ThingWorx restart?
Ans: Yes, If I execute the "ConnectDataSource" service, error get resolved, or if I restart my Server in which InfluxDB started before the Thingworx.
5) Is the issue only Influx-related or Postgres is also affected?
Ans: Yes, the issue is only related to InfluxDB.
In your case, there is unfortunately no real solution, influx must be started before ThingWorx.
Ok. so there is no way to check the connection of the Influx BB persistence provider.