# beginTransaction not working on gateway scripts

**URL:** <https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431>\
**Category:** Ignition\
**Created:** [October 17, 2013, 1:27pm UTC](https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431 "2013-10-17T13:27:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmazzola](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gmazzola](https://forum.inductiveautomation.com/u/gmazzola)\
**Post date:** [October 17, 2013, 1:27pm UTC](https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431/1 "2013-10-17T13:27:04Z")

</div>

beginTransaction with a blank datasource is not taking the default database connection when is invoked on the gateway context, i.e. a timer gateway script.

I’m getting the error “Cannot find database connection - name cannot be empty string.”

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [October 18, 2013, 3:56pm UTC](https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431/2 "2013-10-18T15:56:39Z")

</div>

Thanks for letting us know. I was able to replicate this and will file a bug ticket.

Best,

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [October 18, 2013, 4:18pm UTC](https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431/3 "2013-10-18T16:18:40Z")

</div>

BTW, if you use something like `txId = system.db.beginTransaction(database="",timeout=5000)` beginTransaction will use the default database without an error.

HTH,

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 8, 2013, 7:33pm UTC](https://forum.inductiveautomation.com/t/begintransaction-not-working-on-gateway-scripts/7431/4 "2013-11-08T19:33:52Z")

</div>

This has been fixed for 7.6.4-rc4
