# Store and Forward Alarm

**URL:** <https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064>\
**Category:** Ignition\
**Created:** [August 27, 2012, 6:56pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064 "2012-08-27T18:56:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [August 27, 2012, 6:56pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/1 "2012-08-27T18:56:32Z")

</div>

Twice in the last week something went wrong with my customer’s “store and forward” process. The first time, I caught it before the local cache was full. The second time, I was too late and lost 49,000 records. (Local Cache is set to 100,000 records.)

Is there an alarm I can set up to notify me that the store and forward process has broken?

Of course solving the problem is the best approach but this also happened to me last year and I really don’t like losing data so an alarm would be handy while I am debugging the problem.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [August 27, 2012, 8:08pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/2 "2012-08-27T20:08:59Z")

</div>

Yes, you can. Just make an expression tag with the following expression:`getCachedRowCount("YourDBName")`It will return the number of rows. You can alarm on the expression tag when it gets over some threshold.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [August 27, 2012, 10:17pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/3 "2012-08-27T22:17:25Z")

</div>

perfect!

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [August 29, 2012, 10:55pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/4 "2012-08-29T22:55:00Z")

</div>

Unfortunately getCachedRowCount() is not returning a useful number. I have 1600 rows pending in the local cache and it is returning a value of -1???

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [August 29, 2012, 11:06pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/5 "2012-08-29T23:06:48Z")

</div>

Found the problem. The cache is in default\_db not default. Therefore when getCachedRowCount() is used it is evaluating default not default\_db (which it created, by the way). Change it to default\_db (where default is your database name and everything works).

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [August 29, 2012, 11:18pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/6 "2012-08-29T23:18:08Z")

</div>

That function should only return -1 if the data source name is incorrect. You’ll want it to be the name of Ignition’s connection to your database.

If you are not specifying a data source, then it defaults to the default data source for the SQLTag provider which will need to be set up in the Ignition Gateway: Configure --\> SQLTags: Real-time --\> Edit

---

<div class="post-metadata">

**Author:** ![Travis.Dreier](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@Travis.Dreier](https://forum.inductiveautomation.com/u/Travis.Dreier)\
**Post date:** [February 4, 2021, 7:25pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/7 "2021-02-04T19:25:35Z")

</div>

Is it possible to read getCashedRowCount on a backup gateway. Just found out that the cache is full on the backup and so when failover occurs data is lost.

---

<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:** [February 4, 2021, 7:39pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-alarm/5064/8 "2021-02-04T19:39:13Z")

</div>

As of 8.1.2 there are system tags available that hold information about the store and forward system:

> **[Ignition 8.1.2: Perspective UI and Component Property Updates, and...](https://inductiveautomation.com/blog/ignition-812-perspective-ui-and-component-property-updates-and-storeandforward-system-tags)**
>
> The release train for Ignition 8 continues to deliver stability and quality-of-life improvements to our users. Ignition 8.1.2 focuses on minor updates to the Perspective Module and System Tags. Specifically, the Perspective Module gets updates to its...
