From: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
To: Postgresql General Group <pgsql-general@lists.postgresql.org>
Subject: Re: Need to find the no. of connections for a database
Date: Fri, 28 Feb 2020 13:50:52 +0000 (UTC)
Message-ID: <1434627324.3350491.1582897852456@mail.yahoo.com> (raw)
In-Reply-To: <bbe88803-4b16-34a7-255f-81f47bd2823d@gmail.com>
References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com>
<1393516227.2562442.1582789296867@mail.yahoo.com>
<C06A448C-51BC-43B9-A0CF-558F28E0090E@gmx.com>
<1654972450.2631031.1582803351218@mail.yahoo.com>
<72f62e47-689a-351a-a711-6cfb7312d282@wp.pl>
<1401820409.2680701.1582810637855@mail.yahoo.com>
<af11c806-4850-8837-b8ca-89614dc4f49f@wp.pl>
<561727835.2707508.1582813582038@mail.yahoo.com>
<ad504885-51ed-e356-b821-ec9b73dc0810@wp.pl>
<1151434427.3100461.1582852216341@mail.yahoo.com>
<35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com>
<bbe88803-4b16-34a7-255f-81f47bd2823d@gmail.com>
Since the no. of entry screens to be locked might increase with enhancement(s), the approach could be 1. On completion of all entries by all, say for a day.2. When opening the report, check whether only one user has logged in. Close the report window, if there are more than one users.3. Flag somewhere in the db, that the processing has started.4. Check at the opening event of the 'tobe locked screens', whether this flag set in point 3. If set, quit the screen.5. Create a report from the entered data.
6. Create / Modify required entries from the values arrived in the report. [ long process ]7. Once completed, commit all data. Reset the flag set in point 3.8. Ensure that no data entered for the processed period. Data entered will be for another date. Data cannot [should] not entered for the processed date.
If this works out, we need to find a way to count the no. of users logged in the database.
On Friday, 28 February, 2020, 11:35:48 am IST, Rob Sargent <robjsargent@gmail.com> wrote:
On 2/27/20 10:38 PM, rob stone wrote:
>
> If the menu is built from a table in your database, then when
> "Processing report" starts you could set a flag (boolean) against those
> items so that if anybody tried to log-in or access those items, you
> could simply display a message along the lines of "Processing report is
> running. Please try again later".
>
> When "Processing report" finishes, it just clears that flag.
>
> HTH,
> Rob
>
Conversely, the OP could be asking for a way to turn "process report" to
active state when no one is using the other features: each of them could
set a lock/counter I guess and when all counters are zero enable process
button. The notion of waiting for "all clear" from the app or the db
before running reports does seem odd though. Do certain actions from
the app leave the database in an inconsistent state and break the report
were it run at the same time?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: sivapostgres@yahoo.com
Subject: Re: Need to find the no. of connections for a database
In-Reply-To: <1434627324.3350491.1582897852456@mail.yahoo.com>
References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com> <1393516227.2562442.1582789296867@mail.yahoo.com> <C06A448C-51BC-43B9-A0CF-558F28E0090E@gmx.com> <1654972450.2631031.1582803351218@mail.yahoo.com> <72f62e47-689a-351a-a711-6cfb7312d282@wp.pl> <1401820409.2680701.1582810637855@mail.yahoo.com> <af11c806-4850-8837-b8ca-89614dc4f49f@wp.pl> <561727835.2707508.1582813582038@mail.yahoo.com> <ad504885-51ed-e356-b821-ec9b73dc0810@wp.pl> <1151434427.3100461.1582852216341@mail.yahoo.com> <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com> <bbe88803-4b16-34a7-255f-81f47bd2823d@gmail.com> <1434627324.3350491.1582897852456@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox