Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: Question about sqlite3 and locking / read-only mode
      (Chris Clemson)


----------------------------------------------------------------------

Message: 1
Date: Thu, 3 Aug 2023 09:02:11 +0100
From: Chris Clemson <chris.clem...@gogreenit.net>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] Question about sqlite3 and locking /
        read-only mode
Message-ID: <db0b58c9-4374-beff-c339-962a8c2d7...@gogreenit.net>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Oops,

I just realised i missed the reply, sorry! I've only just got back to 
looking at this again.

sqlite3 from the command line is fine.

The log message about the busy timeout is from the motion service in linux.

In PHP i've set "$db->exec('PRAGMA busy_timeout = 5000;');" to try and 
help, but not sure if it's made any difference yet.

How can I do the same for motions sqlite3 access?

Originally (before PHP) i was using bash scripts to generate the HTML 
and delete unwanted video entries from the database, and that worked 
fine, but it was really slow.

I started re-implementing it in PHP, which is a lot faster, and of 
course only generates pages when I request them, which is a lot more 
efficient, but only since using PHP have I started having locking problems.

Thanks,

Chris

On 25/04/2023 19:05, tosiara wrote:
> So, it works from command line, but does not work from php script?
>
> On Mon, Apr 24, 2023, 22:21 Chris Clemson 
> <chris.clem...@gogreenit.net> wrote:
>
>     Hi Everyone,
>
>     I am using motion with 5 cameras and an sqlite database.
>
>     I am trying to use PHP to create an interface for it, which is
>     partially working, but quite often the DB goes into "read-only"
>     mode, even though I can manipulate the database from the sqlite3
>     command in a bash shell.
>
>     I did notice that I get the following messages on start up:
>
>     dbse_init_sqlite3: Setting busy timeout to 0 msec
>
>
>     Could this be the problem? How can I change the timeout to a couple of 
> seconds or something?
>     My setup is too simple to warrant a whole mysql (or similar) setup, and I 
> want as fewer dependencies as possible.
>     If I stop motion (and/or apache) and start it again, that usually fixes 
> the problem, but it's difficult to tell when this happens, unless I write 
> some sort of log parser, which seems a bit of a kludge.
>
>     Thanks,
>
>     Chris
>
>     _______________________________________________
>     Motion-user mailing list
>     Motion-user@lists.sourceforge.net
>     https://lists.sourceforge.net/lists/listinfo/motion-user
>     https://motion-project.github.io/
>
>     Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
>
>
>
> _______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
>
> Unsubscribe:https://lists.sourceforge.net/lists/options/motion-user

-- 
Chris Clemson - IT Contractor
Go Green IT Ltd
M: +447770916901
W:http://www.gogreenit.net
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 204, Issue 1
*******************************************

Reply via email to