Ok, thankyou for your replies @Igor: I think you misunderstood. I only have one connection to the database (provided by the JDBC driver). I only care about and use that one connection (no other applications access the database). I was wondering if database trigger could be used to notify the application (for example, have a trigger (via CREATE TRIGGER etc) that gets triggered when a table is updated).
@J. King: Do you mean like what is described here? http://www.webdotdev.com/nvd/content/view/347/99999999/1/9/ I was trying to stay away from hacking SQLite directly (remember its a Java application im developing, so I cant just extend the C library) On Tue, Nov 24, 2009 at 5:29 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Erin Drummond <erin....@gmail.com> wrote: >> I am developing a p2p application (in Java) which has a SQLite >> database attached. I am currently using the sqlitejdbc JDBC driver for >> database access. >> Ideally, I want SQLite to notify the application whenever a change is >> made in the database, so it can propagate the change to other peers. >> Currently it finds changes by constantly polling the database, however >> this is not ideal as it wont scale well. > > An SQLite database connection can detect a change made to the database on > another connection no better than a FILE* handle can detect an fwrite made to > the same file on another FILE* handle. Which is to say, not at all. > >> Is it possible for an application to be notified when a trigger inside >> the database is fired? > > Trigger is not fired on a database - it's fired on a database connection. > > There are plenty of interprocess communication mechanisms provided by any > decent operating system. SQLite is not one of them. > > Igor Tandetnik > > > _______________________________________________ > 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