1
votes

I have 2 threads: one reader and one writer. The database is set to journal in WAL mode. I created the following trigger on on the reader object:

CREATE TEMPORARY TRIGGER 'Foo.trigg' 
IF NOT EXISTS 
AFTER INSERT ON Foo
FOR EACH ROW 
BEGIN 
SELECT bar(NEW.id, NEW.value); 
END;

where bar is a custom defined function installed on both objects as well. I put a breakpoint in bar and it is never reached. Am I doing something wrong (perhaps elsewhere) or does SQLite not support cross thread signaling like this? (I am leaning towards me doing something wrong because it doesnt seem to hit the breakpoint even if I create the trigger on the write threads object)

1

1 Answers

1
votes

SQLite is not a client/server database, it is just an embedded library that directly accesses the database file. All SQLite connections are completely separate.

A trigger runs inside the same connection that executes the actual command that triggered the trigger, and calls the user-defined function registered in that connection.