Re: [sqlite] any way to find out how many current connections to db?

2007-08-13 Thread Ben Combee
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 time.

If you're on a Linux system, you can shell out and run "lsof
/path/to/sql.db" and see all the processes that have the file opened.
You may need to run as root to see all the users, and you should use
the output as a guide, since by the time you parse it, some users may
have quit, others could have joined.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] any way to find out how many current connections to db?

2007-08-13 Thread Joe Wilson
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 using the
database.

--- 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 time.



   

Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] any way to find out how many current connections to db?

2007-08-13 Thread Chase


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


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] any way to find out how many current connections to db?

2007-08-12 Thread John Stanton

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?

thanks.

- chase




- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] any way to find out how many current connections to db?

2007-08-11 Thread Chase


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




-
To unsubscribe, send email to [EMAIL PROTECTED]
-