# 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:** ignition81, perspective\
**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:** 4

<div class="post-metadata">

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

</div>

> [@mdemaris](#):
>
> Project Library package?

Correct, its in the project at the top of our inheritance stack. We've also put stuff like pturmel's `later.py`, `xml.py` and `queueUtil.py` in there.

Edit, looks like this issue has been around a while? Found this:

> [@\[IGN-3829\] Error executing system.db.commitTransaction](https://forum.inductiveautomation.com/t/ign-3829-error-executing-system-db-committransaction/49595/27):
>
> I had a similar problem when I was trying to set up an all or nothing write to our DB. What fixed it for me was the first query in the transaction (after getting the transaction ID) needed to have the project argument filled. Subsequent named query calls do not need that parameter filled. This worked: txID = system.db.beginNamedQueryTransaction(project="project1", database="database1") try: system.db.runNamedQuery(project="project1", path="query1", params=params1, tx=txID) #do some stu…

Also, if you are interested, a transaction decorator that automatically catches errors:

> [@Script Benchmarking with Decorators Example](https://forum.inductiveautomation.com/t/script-benchmarking-with-decorators-example/63507/5):
>
> I made something similar to what you are aiming for but its also made for managing database transactions and errors in a standard way by creating a Response object that then I inspect after. import functools import timeit import traceback from forms2.structs import Response import java.lang.Throwable class handleTransaction(object): def \_\_init\_\_(self, logger): self.logger = logger def \_\_call\_\_(self, inner\_func): """ We do 'tx' not in kwargs a few times here. If a fucntion has tx=None…

---

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