Randomly missing records when writing to SQL database
Hello everybody,
I am using a Thing with MSSqlServer template to connect the system to a SQL database. The goal is to log PLC tag (binded to a Remote Thing) values, and store each under its relative database column.
I am using a simple SQL command to write these values into the database:
INSERT INTO *TableName* (Column1,Column2, ..., Column15)
VALUES ([[input1]],[[input2]], ..., [[input15]])
Together with another service linking each input parameter to my remote thing properties:
var params= {
input1: prop1,
input2: prop2,
...
input15: prop15
};
SQLcommand(params);
With this, I am able to ALMOST get what I want. In fact, when looking at what I am actually logging in the SQL database, it looks like this:
Some of the items are consistently well logged, others are only sometimes logged, and my timestamp (which is built concatenating multiple items) gets filled with zeros (or is straight up wrong) when something in the logging process goes wrong. This random failures seem to be only related to some (?) string data types.
The Thingworx application log is filled with the following errors, while nothing unusual pops up in the other logs.
EDIT: I have verified that the "Error executing batch" has nothing to do with my issue, so now I do not have anything reported in the logs.
Any idea what this can be related to?
Cheers to everybody,
Leo

