# Basic questions for getting started with Web

**URL:** <https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751>\
**Category:** Web\
**Created:** [December 19, 2022, 3:59pm UTC](https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751 "2022-12-19T15:59:56Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [January 13, 2023, 7:17pm UTC](https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751/21 "2023-01-13T19:17:59Z")

</div>

There are two approaches and I think you’re mixing them together.

1. A constant keep-alive request. `SELECT 1` sent every 30 seconds or so just to keep the connection alive.
2. A try-fail-reconnect system. Try the query. If it fails with a disconnection, reconnect and try again.

In both cases pool these connections and serve them as necessary. A new connection for every SQL query can quickly exhaust your maximum connections if your server is busy.

---

<div class="post-metadata">

**Author:** ![Christoph\_Emrich](https://forum.xojo.com/user_avatar/forum.xojo.com/christoph_emrich/32/1727_2.png) [@Christoph\_Emrich](https://forum.xojo.com/u/Christoph_Emrich)\
**Post date:** [January 14, 2023, 8:22am UTC](https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751/22 "2023-01-14T08:22:29Z")

</div>

Is one of these options always “better” than the other or does it depend on the project which one to choose? Which of the two do you prefer?

---

<div class="post-metadata">

**Author:** ![Eric\_Bloom](https://forum.xojo.com/user_avatar/forum.xojo.com/eric_bloom/32/716_2.png) [@Eric\_Bloom](https://forum.xojo.com/u/Eric_Bloom)\
**Post date:** [January 14, 2023, 5:05pm UTC](https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751/23 "2023-01-14T17:05:07Z")

</div>

I’ve been using Tim’s method #2 for many years with desktop and web apps. I wrap my SQL requests in a method that does this, so no extra coding for each database operation. And no extra overhead – if the user walks away from the computer for an hour and comes back, there will be only 1 extra database call. This also allows the database server to disconnect inactive sessions to manage its own resources.

[Previous page](https://forum.xojo.com/t/basic-questions-for-getting-started-with-web/73751.md?page=1)
