Scripted restart of tag provider?

We have an issue where we're using pre-processsed partitions to store summarised tag history data, however we currently have issues we're looking into where the SQL database disconnects randomly and this disrupts the PPP table generation which requires a tag provider restart to fix.

Long story short, can someone provide a script that can restart a tag provider via script?



seemd to work. It won't start back up again though with startup(), haha
.running says it's False after shutdown() and True after startup(), but the tags don't show in the tag browser in the Designer :confused: The tag provider itself is also MIA too, but comes back if I re-save the tag provider from the GW webpage. Obviously I'm missing something...

1 Like

I don't think you can perform the operation you're looking for safely, really. There's a private instantiateProvider method on the tag manager implementation class, and it requires you to pass in a settings record from the ORM. It calls a few methods on the provider, in addition to the startup method; that's probably what you're missing and why things aren't showing up quite correctly.

The, barely, safer way to do this would be to go to the PersistenceInterface from the context, retrieve the persistent record that identifies the provider you want (with an SQuery by name), and then call PersistenceInterface.notifyRecordUpdated(thatRecord), which would kick off the listener in the tag manager and cause it to run the same re-initialization step that an edit -> save does.

I would not go down this road, myself, and would instead lean on the support ticket I'm sure you already filed to get the PPP bug fixed. Right? :wink:


Haha, not me personally, but a colleague filed it. Not sure if he asked for it to be fixed though, I'll check. Definitely, that's the solution though, but this was the interim "fix" while trying to find the issue with the sql database, which seems elusive. I'm not too involved, just thought I'd see if tag provider restart was possible :sweat_smile:

1 Like

This one's my "bug"

I'm certainly pushing for a "proper" mechanism to recover the PPP.