# Transaction " " is closed

**URL:** <https://forum.inductiveautomation.com/t/transaction-is-closed/24080>\
**Category:** Ignition\
**Tags:** database\
**Created:** [April 12, 2019, 7:34am UTC](https://forum.inductiveautomation.com/t/transaction-is-closed/24080 "2019-04-12T07:34:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.shan](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@a.shan](https://forum.inductiveautomation.com/u/a.shan)\
**Post date:** [April 12, 2019, 7:34am UTC](https://forum.inductiveautomation.com/t/transaction-is-closed/24080/1 "2019-04-12T07:34:42Z")

</div>

Hi All,

I am having the following issues running the following script on a push button;

Traceback (most recent call last):  
File “event:actionPerformed”, line 10, in   
java.lang.Exception: java.lang.Exception: Error executing system.db.runUpdateQuery(INSERT INTO BatchInformation (BatchID, LeakDecay, Station4, Plugs, Pins, ElectricalTest) VALUES ( ?, ?, ?, ?, ?, ?), [[190010, Good, Fri Apr 12 07:22:32 BST 2019], [1, Good, Fri Apr 12 08:15:40 BST 2019], [0.0, Good, Fri Apr 12 06:58:51 BST 2019], [0, Good, Fri Apr 12 06:58:51 BST 2019], [2, Good, Fri Apr 12 08:15:40 BST 2019], [16, Good, Fri Apr 12 06:58:51 BST 2019]], SQLServer\_WinAuth, false)

```
caused by Exception: Error executing system.db.runUpdateQuery(INSERT INTO BatchInformation (BatchID, LeakDecay, Station4, Plugs, Pins, ElectricalTest) VALUES ( ?, ?, ?, ?, ?, ?), [[190010, Good, Fri Apr 12 07:22:32 BST 2019], [1, Good, Fri Apr 12 08:15:40 BST 2019], [0.0, Good, Fri Apr 12 06:58:51 BST 2019], [0, Good, Fri Apr 12 06:58:51 BST 2019], [2, Good, Fri Apr 12 08:15:40 BST 2019], [16, Good, Fri Apr 12 06:58:51 BST 2019]], SQLServer_WinAuth, false)
caused by GatewayException: Connection Error: Transaction "SQLServer_WinAuth" is closed.
caused by SQLException: Transaction "SQLServer_WinAuth" is closed.

```

Ignition v8.0.0 (b2019040718)  
Java: Azul Systems, Inc. 11.0.2

My script is as follows;

Batch\_ID\_Val = system.tag.read("[default]BatchID 1/BatchID.Value")  
Leak\_Decay\_Val = system.tag.read("[default]Leak Test/Leak Test Total.value")  
Station\_4\_Val = system.tag.read("[default]Station 4/Station 4 Bad.value")  
Plugs\_Val = system.tag.read("[default]Plugs/Plugs Total.value")  
Pins\_Val = system.tag.read("[default]Pins/Pins Bad.value")  
Electrical\_Test\_Val =system.tag.read("[default]Station Fails/St17.value")  
dbconnection = “SQLServer\_WinAuth”

system.db.runUpdateQuery(“INSERT INTO BatchInformation (BatchID, LeakDecay, Station4, Plugs, Pins, ElectricalTest) VALUES ( ?, ?, ?, ?, ?, ?)”,[Batch\_ID\_Val, Leak\_Decay\_Val, Station\_4\_Val, Plugs\_Val, Pins\_Val, Electrical\_Test\_Val], dbconnection)

Any help would be appreciated,  
Thanks

---

<div class="post-metadata">

**Author:** ![boyergary](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/boyergary/32/10316_2.png) [@boyergary](https://forum.inductiveautomation.com/u/boyergary)\
**Post date:** [August 27, 2019, 2:20pm UTC](https://forum.inductiveautomation.com/t/transaction-is-closed/24080/2 "2019-08-27T14:20:50Z")

</div>

I know this is a little late, but you are trying to insert the value returned from a tag which is actually a tuple of three values. You want to just use the “value” of each tag, not the entire tuple.

So your parameter list should be [Batch\_ID\_Val.value, Leak\_Decay\_Val.value, etc.]
