# Stored Procedure Transaction Group

**URL:** <https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632>\
**Category:** Ignition\
**Created:** [September 6, 2024, 1:29pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632 "2024-09-06T13:29:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thidalgo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thidalgo](https://forum.inductiveautomation.com/u/thidalgo)\
**Post date:** [September 6, 2024, 1:29pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/1 "2024-09-06T13:29:54Z")

</div>

Does anybody know why this transaction group is firing the stored procedure one time per item (three times) instead of one time for the three items?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d768f736a59ade543db8bbc297304ccd81fb247b.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/78f9dc359081a9531feee41120a8b9c08067a10d.png)

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 6, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/2 "2024-09-06T20:21:45Z")

</div>

Can you share your Trigger tab? I would assume you've got the triggers configured incorrectly.

---

<div class="post-metadata">

**Author:** ![thidalgo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thidalgo](https://forum.inductiveautomation.com/u/thidalgo)\
**Post date:** [September 8, 2024, 3:23pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/3 "2024-09-08T15:23:49Z")

</div>

Sure, as far as I understood I didn't have to configurr any trigger for the desired behavior.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/d/9d9dd5350147c8e955e952bf3fb9063c39543981.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 8, 2024, 4:36pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/4 "2024-09-08T16:36:32Z")

</div>

Ah, I see.

- Without configuring a trigger, a transaction group executes unconditionally at its schedule. Every five seconds, in this case.

- A transaction group will not run in a disabled project.

- A transaction group defined in an **inheritable** project will run in **every** leaf project that inherits from it.

I'm going to guess you have three leaf projects inheriting from the project where this group is defined.

---

<div class="post-metadata">

**Author:** ![thidalgo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thidalgo](https://forum.inductiveautomation.com/u/thidalgo)\
**Post date:** [September 9, 2024, 1:53pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/5 "2024-09-09T13:53:23Z")

</div>

Absolutely yes!

The problem was that every leaf project was launching the transaction group.

After reviewing the Ignition documentation related to "Runnable" objects, the same behavior is expected for Gateway Event Scripts. However, even though I have a timer script defined in the inheritable project, it's not run by all leaf projects. I can only identify one execution of the script, when there should be three.

Thanks for your useful response.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 9, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/6 "2024-09-09T13:58:05Z")

</div>

> [@thidalgo](#):
>
> the same behavior is expected for Gateway Event Scripts

Yes, but if any project has edited/overridden the gateway event scripts resource, any event scripts added to the inheritable project later will not propagate to the leaf projects.

Anyways, don't try to define anything but library scripts, Perspective views, Vision windows, and Vision templates in your inheritable projects. Gateway events should only ever be defined in a leaf project dedicated to "background" operations. See this topic for related ideas:

> [@Where do/should Gateway Scripts live with respect to an inherited project structure?](https://forum.inductiveautomation.com/t/where-do-should-gateway-scripts-live-with-respect-to-an-inherited-project-structure/83460/3):
>
> Put all of the logic in project library scripts, in the "universe" project at the root of your hierarchy, if you must. Then, in leaf projects, use one-line calls to the appropriate logic from event scripts and message handlers. (I don't agree with your desire, but this is what you must do to achieve it.) I recommend you not put all your scripts (eggs) in one inheritable project (basket). I recommend a hierarchy something like this: universe ├bg\_common │├gsp │├background1 │├background2 │└we…

---

<div class="post-metadata">

**Author:** ![thidalgo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thidalgo](https://forum.inductiveautomation.com/u/thidalgo)\
**Post date:** [September 9, 2024, 2:41pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/7 "2024-09-09T14:41:16Z")

</div>

> [@pturmel](#):
>
> Yes, but if any project has edited/overridden the gateway event scripts resource, any event scripts added to the inheritable project later will not propagate to the leaf projects.

I've checked, and none of the three leaf projects overwrite the Gateway Event Scripts. I've put a print "_**" sentence in a Timer Script (30s) of the Inheritable Project and I can see that only just one "**_" string is written in the log. So it seems like the inheritable project is the one that is executing the script, not the leaves. Maybe there is a configurable parameter in the gateways to activate this behavior.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 9, 2024, 2:47pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/8 "2024-09-09T14:47:32Z")

</div>

> [@thidalgo](#):
>
> So it seems like the inheritable project is the one that is executing the script, not the leaves.

Not possible. Include the result from `system.util.getProjectName()` in your print.

---

<div class="post-metadata">

**Author:** ![thidalgo](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@thidalgo](https://forum.inductiveautomation.com/u/thidalgo)\
**Post date:** [September 9, 2024, 3:59pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-transaction-group/95632/9 "2024-09-09T15:59:45Z")

</div>

> [@pturmel](#):
>
> `system.util.getProjectName()` in your print.

Done, you're right, the one writing the print was a leaf project, and the other two were overwriting the resource. Sorry, I misjudged when verifying it.
