# How to deal with database, historian, not loaded

**URL:** <https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 12, 2024, 8:58pm UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588 "2024-02-12T20:58:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [February 12, 2024, 8:58pm UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/1 "2024-02-12T20:58:10Z")

</div>

In perspective, is there a way to deal with the below?

I got a requirement, to display "page error, retry" popup, when, for some reason,  
connectivity to database/historian is loss, thus on page, data are not completely loaded and show Null.

In this age where application is driven by data source that are stored remotely.  
I hope there is a way to check that something when wrong, and will raise popup: "something went wrong, please refresh".

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 12, 2024, 9:24pm UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/2 "2024-02-12T21:24:03Z")

</div>

Of course, but the how of the answer is a bit vague based on the information you have provided.

Is this specifically for the entire project or is it for a specific view or component?

There are various way that a lack of connectivity to a data source will present itself and depending on how you are accessing that, the way you can detect it can vary.

For instance you could use a Gateway Scheduled or Timer Event in conjunction with `system.db.getConnectionInfo()` to show a global popup.

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [February 12, 2024, 9:47pm UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/3 "2024-02-12T21:47:10Z")

</div>

Thanks, I guess that is the way.

For now, On page startup, after few seconds, check if value is Null and check connections..

On my case, I am loading data both from DB and historian, I should check connection of both, and allow user to refresh in case of Null.

I guess, I also could run a Now() binding, for timer event, to check connection continuously and raise/hide a popup when data is bad/good.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 12, 2024, 11:35pm UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/4 "2024-02-12T23:35:55Z")

</div>

The Expression Language `now()` function defaults to 1000 ms poll rate. You can specify a rate in milliseconds such as `now(3000)`.

[https://docs.inductiveautomation.com/display/DOC81/now](https://docs.inductiveautomation.com/display/DOC81/now)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 13, 2024, 12:43am UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/5 "2024-02-13T00:43:47Z")

</div>

> [@Eugene49](#):
>
> Thanks, I guess that is the way

It is _ **a** _ way. _The_ way would depend on your exact needs.

> [@Eugene49](#):
>
> I am loading data both from DB and historian

This terminology is quite possibly mixed.

The historian is not always a separate database connection. In fact I would say in most circumstances they are the same "connection"\*. It doesn't have to be, by any means, but most often is.

\*Ignition actually used a connection pool, so they wouldn't have the exact same connection but rather be connected to the same endpoint.

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [February 13, 2024, 1:08am UTC](https://forum.inductiveautomation.com/t/how-to-deal-with-database-historian-not-loaded/85588/6 "2024-02-13T01:08:35Z")

</div>

I agree, that in most cases Historian is pointing to database as well.  
So down in database is also down in Historian.

But we are using Canary as historian, and I don't know how it was configured.

In gateway config, I see both database and historian has Status Indication.

Any idea how to get historian status?
