On 8/13/07, Chase <[EMAIL PROTECTED]> wrote:
>
> is there any way (in c/c++) to find out how many current connections
> there are to a database that i am connected to?
>
> i'd like to do some housekeeping on the database every so often, but
> only if there's no one else connected to it at the
Rather than count the number of connections which would be prone
to failure due to race conditions, you should do this instead:
BEGIN EXCLUSIVE;
-- run whatever SQL statements you want here,
-- or copy the database file.
COMMIT;
Just schedule this job off-hours when people are not likely
is there any way (in c/c++) to find out how many current connections
there are to a database that i am connected to?
i'd like to do some housekeeping on the database every so often, but
only if there's no one else connected to it at the time.
any ideas?
thanks.
- chase
Try using lsof.
Chase wrote:
is there any way (in c/c++) to find out how many current connections
there are to a database that i am connected to?
i'd like to do some housekeeping on the database every so often, but
only if there's no one else connected to it at the time.
any ideas?
is there any way (in c/c++) to find out how many current connections
there are to a database that i am connected to?
i'd like to do some housekeeping on the database every so often, but
only if there's no one else connected to it at the time.
any ideas?
thanks.
- chase
5 matches
Mail list logo