Thanks for the input so far. To clarify the whole setup works like this

1- bash scripts run every 10 minutes and generate information that is
inserted into tables in a sqlite db, the tables are only accessed once
simultaneously
2- PHP scripts read from those tables to display information on frontend.

I did disable part two, so right now this is all about the write process to
the database. 4 scripts run simultaneously, writing 500 entries each
through a while loop to 500 tables each every 10 minutes.

The relevant part is here

sqlite3 websites.db  "PRAGMA busy_timeout=1500;insert into [$SITE]
(date,eu,us) values ($DATE,$DIFF,$DIFF2);"

But I still get frequent "Error: database is locked" , for further testing
 I did only run one script at one time, but the error still occurs at the
same rate.

Please advice.

Regards

On Sat, Oct 25, 2014 at 8:19 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 25 Oct 2014, at 7:16pm, Ali Jawad <alijaw...@gmail.com> wrote:
>
> > Thanks Simon, the create process is a one off. As for the table name I
> did
> > use this approach as to not accumulate too much data in one table and
> > instead split the data in multiple tables. From a design POV  in sqlite
> is
> > this a mistake. And will the pragma for php eliminate locks ?
>
> You should definitely execute the PRAGMA as a separate command, not as
> part of your SELECT command.
>
> I do not know for sure that, done as above, it will fix your lock.  I'm
> not sure why you are getting the locks.  But it is the next step for you to
> try, and if it doesn't fix them it will provide good diagnostic information.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to