Skip to main content
1-Visitor
June 1, 2022
Solved

How to check whether persistence provider is connected to ThingWorx

  • June 1, 2022
  • 1 reply
  • 2579 views

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.

Best answer by PaiChung

In your case, there is unfortunately no real solution, influx must be started before ThingWorx.

1 reply

22-Sapphire I
June 1, 2022

You could create a DataTable or Stream supported by that persistence provider and do a data retrieval?

VVarshney1-VisitorAuthor
1-Visitor
June 1, 2022

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.

17-Peridot
June 1, 2022

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?