Hi, can anybody help me solve this one? I am getting the following ‘Transaction is closed’ error on a pushbutton actionPerformed event:
Here is my script:
==========
dbConn = “dbName”
table = event.source.parent.getComponent(“Table”)
data = table.data
line = data.getValueAt(table.selectedRow,“Row1”)
charge_no = data.getValueAt(table.selectedRow,“Row2”)
if system.gui.confirm(“Are you sure you want to delete the selected record?”):
system.db.runPrepUpdate(“DELETE FROM dbTable WHERE line = ? AND charge_no = ?”, [Row1], [Row2], dbConn)
system.db.refresh(event.source.parent.getComponent(‘Table’), “data”)
system.gui.messageBox(“Record item deleted”)
Here is the error message:
==========
Traceback (most recent call last):
File “event:actionPerformed”, line 9, in
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(DELETE FROM dbTable WHERE Row1 = ? AND Row2 = ?, [4], [23], Database, false, false)
caused by Exception: Error executing system.db.runPrepUpdate(DELETE FROM dbTable WHERE line = ? AND charge_no = ?, [4], [23], dbName, false, false)
caused by GatewayException: Connection Error: Transaction “dbName” is closed.
caused by SQLException: Transaction “dbName” is closed.
Ignition v7.9.3 (b2017060210)
Java: Oracle Corporation 1.8.0_131
Thanks for any assistance.