I appreciate the suggestion and have implemented the timeout feature, and will 
continue to monitor to see how this affects the database activity.

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
Sent: Tuesday, May 08, 2012 5:36 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] SQLite via TCL Question


On 8 May 2012, at 9:51pm, "Tilsley, Jerry M." <jmtils...@st-claire.org> wrote:

> This is probably a newbie question so please bear with me.  I'm accessing a 
> SQLite database through TCL and periodically I get a "Database Locked" error. 
>  This is a multi-thread process that writes to the DB, do I need to enable 
> WAL for this, if so, do I do this from the TCL side or the command-line side?

You probably haven't set a timeout, which means that if two threads clash 
neither backs off to wait for the other to finish.  Use this function:

<http://sqlite.org/c3ref/busy_timeout.html>

to set a non-zero timeout (I suggest five seconds) after the connection is 
opened, and try again.  If you don't have access to that API, look for an 
equivalent in the API you're using.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

________________________________

Disclaimer****
This email is confidential and intended solely for the use of the individual to 
whom it is addressed. Any views or opinions presented are solely those of the 
author and do not necessarily represent those of St. Claire Regional Medical 
Center. If you are not the intended recipient, be advised that you have 
received this email in error and that any use, dissemination, forwarding, 
printing or copying of the email is strictly prohibited. If you received this 
email in error please notify the St. Claire Regional Helpdesk by telephone at 
606-783-6565.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to