I did some research into this topic . I read the following sqlite-users
posts http://www.mail-archive.com/[email protected]/msg25752.html and
http://www.mail-archive.com/[email protected]/msg25762.html . From these
posts, its says as of 2007, there is no sqlite public api for querying the
number of open connections to a sqlite database. In UNIX and Linux , there is
/usr/sbin/lsof name-of-sqlite-database. Is there any way that I can execute
lsof from within the program inserting the 5.4 million rows whenever
sqlite3_step returns error code 1 after inserting a row. It appears that once
the program executes the lsof it much exit. Or is it possible for the parent
process to resuming running again
Also, I was wondering about windows. Process explorer is a good
tool. However, is there any open source program or source code then can print
information about each open connection? Thank you.
From: [email protected]
To: [email protected]
Subject: iIs it possible to determine how many open connections are active for
a sqlite database?
Date: Fri, 18 Feb 2011 22:24:38 -0500
Good evening, I am trying to insert 5.4 million rows to a sqlite database
running in Windows or Unix/Linux. I am using a transaction to try to speed up
the insertions. When the sqlite database is accessed by multiple connections,
and one of the processes modifies the database, the SQLite database is locked
until that transaction is committed. As a result, I periodically get a sqlite
return code of 1 from sqlite3_step after inserting one of the 5.4 million rows.
I am running Process Explorer on windows to see if another user or process has
a connection to the sqlite database table.
The Process explorer tells me my executable is the only process with
connections to the sqlite database. The database locking problem is causing me
to skip insertions. I would like to verify if my executable does indeed have
multiple connections to the sqlite database. Is there a sqlite API does can
tell me how many open connections my executable is responsible for? Also, it is
possible to determine the lines of code(i.e like a gdb backtrace) in my
application are responsible for each of the multiple connection? Thank you.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users