On Mon, 31 Aug 2009 11:58:42 +0200, Alejandro Ruiz-Oriol <aruiz...@itelsys.com> wrote:
>I've been doing some further reading and I think that I already have the >answer and it's "No, no way to avoid this". > >As far as I've read, when you start any update function, SQLite makes an >exclusive write lock to the table. As far as I'm excuting from inside an >update trigger, the database is "exclusivily write locked", so if that >trigger tries to write to the DB, we will end up in a deadlock. > >The only thing that can "save" me from this behavior is if there is someway >to tell SQLite that the update is over, before the trigger finished. > >I've tried to put a commit inside the trigger, but I get a "syntax error". > >I'm working in to aporaches to the workarund. One i ssplit the table in two >(due to the logic of my aplication, maybe I can do this, cause the files >updated by the trigger can have some kind of logic that I can use to split >the table in 2 different tables). The other is to start a background php >task that wait till the DB lock is released and then, tries the insert. > >Any suggestion? I think the registered callback function runs in the same context as the php script that created the first conection, and it should use that conenction, instead of creating a second connection. It's just a suggestion. I didn't try this myself. -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users