IMD SolutionComputing LibraryShop main store

Troubleshooting

Why a test sequence loses its SQL Server connection after idle

Edge computing and IIoT Published 8 min read By IMD Solution engineering team

Short answer

TestStand's configured result-processing logging opens its database connection at the first unit logged and holds it until the sequence stops, so one network or SQL Server interruption silently drops the records of every unit after it. The fix is to release the execution-owned datalink reference, the property under RunState.Execution whose name begins with TSDatabaseLoggingDatalink, at the end of the Log to Database callback so each unit opens a fresh connection.

On this page
  1. The connection spans the whole sequence, not one unit
  2. Rule out the network and server before touching the callback
  3. Find the property that owns the connection
  4. Building the name for a TestStand 2010 tester with schema UUT Results 2024
  5. Release the reference at the end of the Log to Database callback
  6. Verify the fix and decide by case
  7. Questions asked

Yes: the database connection configured under Configure > Result Processing is opened when the first unit under test reaches logging and stays open for every unit after it until the sequence stops. One network hiccup or SQL Server restart during that lifetime invalidates the connection, and every later unit logs into a dead line — the error usually lands just after the PASS/FAIL banner, where operators dismiss it. The result is a passed unit with no database record, and the next-assembly tester that looks for that serial number fails on the missing row. The fix is to release the execution-owned datalink reference at the end of the Log to Database callback, so each unit reopens a fresh connection the way an open-write-close tester already does. This article locates the connection, names the property that owns it on each version, works the name construction for a 2010 tester, and ends with the decision for each case.

The connection spans the whole sequence, not one unit #

The failing connection is the result-processing logging configured in that menu path, or its equivalent location in older installs. It is not a session a test step opens for itself. Vendor documentation describes TestStand database operations as sessions whose lifetime depends on the component that holds the connection, and this component holds its session for as long as the execution runs.

TestStand creates the connection with the first unit that reaches database logging, maintains it while units run continuously, and releases it only when the sequence is stopped, terminated or aborted. Waiting at the serial-number prompt is not a stop. The connection stays open through the idle evening, the overnight wait and the weekend — exactly the intervals in which a network hiccup or a SQL Server restart invalidates it without any visible sign at the tester.

Two separate paths produce a logged unit: the sequence computes the result, then result processing sends it through the configured provider and the network to SQL Server. The PASS/FAIL banner proves the first path only. When the second path is dead, the banner still shows, the error follows it, and the units logged while the connection was dead leave no rows at all — which is why the next-assembly tester cannot find the passed serial number.

What you see on the tester What it separates Check next
Error appears right after the PASS/FAIL banner Test execution from database persistence Query the database for that serial number
Failures cluster after nights and weekends The held connection spans the idle interval Correlate the interval with switch and server events
The higher-assembly tester cannot find a passed subassembly A missing upstream row, not a failed retest Read the upstream tester's logging error first

Rule out the network and server before touching the callback #

A fresh connection cannot log through an unavailable server, a disconnected interface or a blocked database endpoint, and a healed network does not revive the connection a running execution still holds. Separate the two before editing anything:

  1. Record the tester, the serial number, the failure time and the full database error text for every occurrence.
  2. Read the configured server or instance, the transport and the port from the deployed connection configuration. The SQL Server version and endpoint for this failure pattern were never documented, so read yours rather than substituting a default.
  3. Check the tester's interface and its switch port for link events in the failure interval. A physical break kills any connection, held or fresh.
  4. Attempt a fresh connection from the tester with the same provider, database and authentication that result processing uses. Basic host reachability alone does not exercise the database connection.
  5. When the fresh connection succeeds and the running execution still reports logging errors, the held-connection fault is confirmed; continue to the reset below. When the fresh connection also fails, fix the path or the server first — no callback change logs through a dead endpoint.

A SQL Server connection can also fail on network state alone even when client and server look local to each other; why an Ignition local SQL Server connection depends on the network documents the same trap on a SCADA host.

One proposed explanation, an idle-connection timeout configured on SQL Server, was never confirmed for this failure pattern. The documented remote query timeout bounds how long a remote operation may take before the server times the operation out, measured in seconds; nothing in the symptom pattern identifies it or any single setting as what ended the connections. Decide what actually broke from the SQL Server error log and the switch-port history for the interval.

Find the property that owns the connection #

After the first unit has passed through logging, the datalink object exists under RunState.Execution. Its name begins with TSDatabaseLoggingDatalink, and the suffix depends on the installation. Shorthand strings such as TSDatabaseLoggingDatalink{GUID} mark where a suffix goes; the braces hold the suffix your installation generates, they are not a literal name to paste.

Installation Suffix built from Replacements applied
TestStand 2010 Parameters.DatabaseOptions.DatabaseSchema.Name spaces become underscores
TestStand 2013 and 2016 with plug-in naming Parameters.ModelPlugin.Base.GUID hyphens become underscores
Another TestStand 2016 installation Parameters.DatabaseOptions.DatabaseSchema.Name periods, spaces and hyphens become underscores

Version alone is not a selector: testers on the same 2016 release turned up with both the plug-in-based and the schema-based forms. Run one unit far enough to invoke logging, pause after the logging step completes, and inspect the properties under RunState.Execution in that execution. A property beginning with TSDatabaseLoggingDatalink appears only after logging has run; if none appears, check the callback, the execution context and the active result-processing configuration before trying to clear any reference.

Building the name for a TestStand 2010 tester with schema UUT Results 2024 #

The inputs, with their sources:

  • The schema name as the Log to Database callback reports it under Parameters.DatabaseOptions.DatabaseSchema.Name. UUT Results 2024 is an example value; read yours from the callback on your own tester.
  • The 2010 rule: the property suffix is the schema name with every space replaced by an underscore.
  • The property base: RunState.Execution.TSDatabaseLoggingDatalink.

The rule in words: apply the character replacements to the schema name and join the result to the base after the prefix, with the suffix in braces as the testers show it.

The arithmetic: UUT Results 2024 contains three spaces, and replacing each with an underscore yields UUT_Results_2024. Joined to the base, the path to look for is RunState.Execution.TSDatabaseLoggingDatalink{UUT_Results_2024}.

The result: that exact string is the expected property name for this example tester. On a plug-in-named tester the same construction runs off the plug-in identifier instead — take Parameters.ModelPlugin.Base.GUID and replace its hyphens with underscores, reading your identifier from the callback rather than reusing anyone else's.

The decision: run one unit, pause after logging completes, open the execution's properties and compare. A confirmed match means you can proceed to the reset; no match means stop and re-derive the name from what the execution actually shows, because an expression pointing at a property that is not there adds a second error to every unit.

Release the reference at the end of the Log to Database callback #

The reset is one step at the end of the Log to Database callback sequence, after the existing logging operation has completed. It is a statement-expression step that assigns Nothing to the reference at the verified path, built from the name you confirmed in the execution rather than pasted from an example. The next unit's logging operation then establishes a connection again.

A LabVIEW implementation locates the same object and assigns a null value with an empty variant constant; the statement-expression step is the simpler route because it needs no separate VI. One habit worth avoiding: parking the constructed name in Step.Result.Status as scratch space overwrites a result field that other steps and reports can read, so give the step its own local variable.

Back up the deployed sequence and the result-processing configuration before editing, and make the change between units rather than mid-test — a mistyped path fails the step for every unit immediately. The payoff matches the testers that never showed the fault: a break then costs at most the unit being logged when it happened, not the rest of the run. The same fault shape, a long-lived write connection silently broken by a network outage, appears on edge logging hosts too; fixing Node-RED InfluxDB write errors after a network outage is the same recovery problem on different software.

Verify the fix and decide by case #

Verify on one tester before rolling the change out:

  1. Run one known unit through the modified callback and query the database for its serial number; the row must be there with its timestamp and result.
  2. Leave the sequence running across the idle interval that produced the original failures, an overnight or weekend wait at the serial-number prompt.
  3. Log the next unit without restarting TestStand and confirm its row appears. A second row after the idle span, with no restart in between, is the pass criterion.
  4. Watch a full shift. Any further logging error now points at the path or the server, and the fresh-connection check earlier in this article separates the two.

The decision for each case:

  • Sequence left running across nights and weekends: apply the reset. The held connection will be invalidated eventually, and the reset caps the loss at the unit in progress.
  • The fresh connection also fails at failure time: the fault is the network path or the server. Repair that first, then add the reset so the next break cannot repeat the loss.
  • Errors only after server maintenance or restarts: add the reset as well. An invalidated connection never revives on its own once the server is healthy again, and the reset removes that dependence.
  • Sequences stopped at every shift: each stop releases the connection, so the exposure is one run only. Add the reset anyway when a run spans a shift change or an idle break; the cost is one step.

Questions asked

Does restarting TestStand fix the lost database logging?

Restarting recreates the execution and its connection state, which is why it is the recovery operators reach for. It is temporary: the next idle evening or weekend holds a connection again, and one break drops the records of every unit logged after it. The datalink reset makes each unit open its own connection, so a restart stops being part of recovering the logging.

Does assigning Nothing close the SQL Server connection immediately?

The documented effect is on the next unit: once the reference is released, the next unit's logging operation establishes a connection again. Whether the server sees the old socket close at that exact moment is not specified, and it does not change the fix. What matters is that no later unit logs through a connection that has been sitting idle since the previous serial number.

Does this apply to versions newer than TestStand 2016?

The confirmed behavior and property naming in this article come from TestStand 2010 through 2016 running on Windows 7 and 10. Versions after that were not part of the observations, so before reusing the suffix rules on a newer install, run one unit and inspect the properties that appear under the execution. The principle still holds: release the logging reference at the end of the callback so the next unit reconnects.

What about the offline processing utility?

An offline processing utility exists as a separate route for results held on the tester, and it is a reasonable backstop for a backlog after an outage. It does not change the connection lifetime of the configured result-processing logging during a run, so it does not replace the reset for keeping commits happening unit by unit.

Can I write my own open, write and close routine in the callback instead?

You can build one, and it gives the same per-unit lifetime the reset produces. The reset is lighter: it keeps the configured logging steps, schema and reporting untouched and only forces the next reconnect. A custom routine has to reproduce the provider, database and authentication choices result processing already applies, and it has to be maintained identically on every tester.

Keep reading

  • Troubleshooting

    Fix Ignition SQL Server connection faults after an upgrade

    After an Ignition 8.1.x upgrade, a faulted SQL Server connection is almost never a credentials problem: the new Java runtime disables TLS 1.0 and 1.1 (builds from 8u291), and a Microsoft JDBC driver as old as 4.0 cannot run on it. Read the Gateway exception, then patch SQL Server to TLS 1.2 per KB3135244 or replace the driver; the reported working pair was 9.4 in place of 4.0.

    Edge computing and IIoT

  • Explainer

    Why OFS alone cannot log M340 data to SQL Server

    OFS is an OPC Data Access server for M340 data: it serves live values with quality to OPC clients and has no database function, so it cannot log to SQL Server by itself. The working path is M340 → OFS → Citect SCADA → SQL Server, with Citect as the OPC client that owns the insert and OFSClient kept as a read-only commissioning tool.

    Edge computing and IIoT

  • Troubleshooting

    Fix InTouch 2023 Test Connection failure to Historian

    Test Connection from InTouch 2023 to a remote Historian fails for two reasons: the Historian node's firewall blocks the SQL Server listener even though ping works, and the Distributed Name Manager history provider does not support Windows credentials. Prove TCP reachability, then use a SQL Server login stored in Credentials Manager.

    Edge computing and IIoT

Why Tier 2 historian replication loses the asset hierarchy view