Hello all
I'm here to get help eliminating possible issues on my end before claiming there's a bug with Ignition.
I'm writing some library functions that generically handle reporting requests. While doing so I'm breaking things apart as much as possible so that someone wanting to inspect the pipeline can call individual pieces of it from the script console. In doing so I noticed that I was unable to update my database from the console context, even with the correct read/write comm mode enabled.
I boiled it down to as simple of a query as I could. This query:
UPDATE READS_ReportRequests SET [Status] = 'Processing'
Runs perfectly fine in any DBM I've tried it with. I then reset the value of the Status column for the singular row in the table to something else.
Recontextualizing it for use in Ignition script console:
query = "UPDATE READS_ReportRequests SET [Status] = 'Processing'"
rows = system.db.runPrepUpdate(query, [])
print rows
Displays 0 and, checking the table, has not done anything. Adding things like targetting the specific PK of that singular row doesn't change anything.
Running a similar script as an onActionPerformed for a button in a Perspective view:
def runAction(self, event):
query = "UPDATE READS_ReportRequests SET [Status] = 'Processing'"
rows = system.db.runPrepUpdate(query, [])
system.perspective.print(rows)
Prints 1 and the update is reflected in the table.
This feels like a bug, but am I missing some context for why this shouldn't work?
I'm using SQL Server, with an admittedly outdated JDBC I've been trying to get updated. But the ability to get this working on a Perspective view/gateway context suggets to me that isn't the issue.