On 10/29/06, David Gewirtz <[EMAIL PROTECTED]> wrote:

I've been exploring SQLite for a number of applications, but one I'd like to
embark on soon is using SQLite to record Web site log file data, so I can
perform SQL-based analysis on my logs, rather than using some thing like
Analog.

Unfortunately, each Web access on the server is likely to be in its own
thread. The scenario I'd probably have to build might go something like
this:

* Web server launches
* SQLite issues sqlite3_open to log db, gets log_ID
* Web server handles user 1 in thread 1, which writes to log db
* Web server handles user 2 in thread 2, which writes to log db
* Web server handles user n in thread n, which writes to log db
* Web server handles admin request for log analysis, which reads from log db
* Web server begins shutdown, closes log db
* Web server shuts down

From my reading, it's just not clear to me whether this is bad behavior for
SQLite 3.3.7. Can SQLite handle this sort of sequence reliably. If not, any
suggestions about how I might proceed or how I should think about it?

If you really need real-time insight into your logs, then see
http://www.sqlite.org/sharedcache.html and
http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/server.c&v=1.6
for example implementation and some more docs on the subject.

Though if you can live with storing logs to text files and reading
them into SQLite db periodically and/or on demand (if that will happen
rare enough to make more sense than above scenario) it will probably
be much simpler to implement.

--
Nemanja Corlija <[EMAIL PROTECTED]>

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

Reply via email to