I run this event script on a button to update a table created and controlled by a standard transaction group that uses an hour meter to update the last row of my table. I thought this would be a good way to clear an entire column of data and ever a new value in the last row of the database.
When I click this button on one of my more laggy windows, it runs through the script and closes the window but does not run the update query.
When I keep this popup open and close the laggy window and try the button again, It works all the time.
My transaction group is set up as bidirectional DB wins and I did try to set OPC wins and it worked a little better on the laggy window which seemed backwards to me.
queryValue = event.source.parent.getComponent(‘Numeric Text Field’).floatValue
same = event.source.parent.MotorID
system.db.runUpdateQuery(“UPDATE motorrun SET [%s] = 0” % (same), ‘NewConnection’)
system.db.runUpdateQuery(“UPDATE motorrun SET [%s] = %f WHERE motorrun_ndx = (SELECT MAX(motorrun_ndx) FROM motorrun)” % (same,queryValue) , ‘NewConnection’)
also, occasionally when I run this script with a new value, it will change it in the database to, not the NEW value, but instead will cast the old value from float to int. So, if I had 55.6 then entered 80, and ran the script, it would change to 55.
I’m wondering what the interplay is with my update query and the transaction group which runs this database. Increasing my exec timing to 30 seconds did not appear to change anything either.
I’ve got a scrolling marquee on my laggy window too, and as I try to run this script, if the marquee is moving, the update usually works, it its stalled… It fails.
Any idea whats going on here?