# Begin Transaction, problem with tx number java.util.map

**URL:** <https://forum.inductiveautomation.com/t/begin-transaction-problem-with-tx-number-java-util-map/106598>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [May 22, 2025, 8:51pm UTC](https://forum.inductiveautomation.com/t/begin-transaction-problem-with-tx-number-java-util-map/106598 "2025-05-22T20:51:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 22, 2025, 9:59pm UTC](https://forum.inductiveautomation.com/t/begin-transaction-problem-with-tx-number-java-util-map/106598/5 "2025-05-22T21:59:09Z")

</div>

> [@ryan.white](#):
>
> `if "perspective" in dir(system):`

This will always be true (in gateway scope, if you have the Perspective module installed) - this won't catch scenarios where you're not in a Perspective launched context but elsewhere on the gateway (e.g. a tag event script). See @nminchin's similar looking code here:

> [@Get current scope in scripting](https://forum.inductiveautomation.com/t/get-current-scope-in-scripting/55686/18):
>
> There are a number of topics about this, with this being the only topic that works to distinguish between gateway and perspective slight_smile thanks @PGriffith and @hunterdg I've incorporated this into @Kyle_Chase 's script from [this topic](https://forum.inductiveautomation.com/t/best-methods-for-checking-script-scope/30201/2): from com.inductiveautomation.ignition.common.model import ApplicationScope try: from com.inductiveautomation.ignition.gateway import IgnitionGateway isGateway = True except ImportError: isGateway = False def getScope(): scope = ApplicationScope.getG…

I'll also mention for posterity here that in 8.3 we introduced new named query scripting functions to address this fundamental inconsistency.

---

_[View the full topic](https://forum.inductiveautomation.com/t/begin-transaction-problem-with-tx-number-java-util-map/106598)._
