Re: [sqlite] Is it possible for SQLite to notify an applicationconnected to it of database changes?

2009-11-23 Thread Erin Drummond
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

Re: [sqlite] Sqlite Java blob

2009-11-23 Thread Peter Kelly
Thanks, I've tried that, but to no avail. Maybe a bit of background, our applaiction generates its froms from the database layout, this is so it can be used for a variety tasks. It talks to mysql and sqlite, so I was trying to keep the code as generic as possibe. I have a procedure -

Re: [sqlite] Sqlite Java blob

2009-11-23 Thread Peter Kelly
Thanks, I've tried that, but to no avail. Maybe a bit of background, our applaiction generates its froms from the database layout, this is so it can be used for a variety tasks. It talks to mysql and sqlite, so I was trying to keep the code as generic as possibe. I have a procedure -

Re: [sqlite] Is it possible for SQLite to notify an applicationconnected to it of database changes?

2009-11-23 Thread Igor Tandetnik
Erin Drummond 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

Re: [sqlite] Is it possible for SQLite to notify an application connected to it of database changes?

2009-11-23 Thread J. King
On Mon, 23 Nov 2009 23:12:12 -0500, Erin Drummond wrote: > Is it possible for an application to be notified when a trigger inside > the database is fired? I imagine you could make the trigger call a user function which notifies the application... -- J. King

[sqlite] Is it possible for SQLite to notify an application connected to it of database changes?

2009-11-23 Thread Erin Drummond
Hi, 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.

Re: [sqlite] Sqlite Java blob

2009-11-23 Thread Ulric Auger
Use PreparedStatement setBytes method. No need to convert to base64. Ulric -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Peter Kelly Sent: November 23, 2009 10:47 PM To: sqlite-users@sqlite.org Subject: [sqlite] Sqlite Java

[sqlite] Sqlite Java blob

2009-11-23 Thread Peter Kelly
Hi, I've been tearining my hair out trying to figure out how store my image data in sqlite using Java. I think the best way to go is just store the base64 encoded string in the column, but I can for the life of me get a prepared statement for that to work. Can anybody show me how they are storing

[sqlite] ANN - DBD::SQLite 1.27 - test it!

2009-11-23 Thread Darren Duncan
All, I am pleased to announce that DBD::SQLite (Self Contained RDBMS in a Perl DBI Driver) version 1.27 has been released on CPAN (by Adam Kennedy). http://search.cpan.org/~adamk/DBD-SQLite-1.27/ This release is the newest one intended for production use and has no known serious bugs. The

Re: [sqlite] begin transaction

2009-11-23 Thread Tom Broadbent
btw - would shared cache mode play a part in this behavior? for example, if i have shared cache mode enabled then i could have a different thread in this process that has a shared lock at the time my thread is trying to begin trans immediate. would this (effectively) cause a lock promotion

Re: [sqlite] begin transaction

2009-11-23 Thread Tom Broadbent
if there are open read cursors this is not by design. i'm reviewing now and ensuring that read cursors are closed. will review more, but all the reads are behind APIs that explicitly finalize (or reset) at the end of the API call..at least this is the intent. it is possible that there is a

Re: [sqlite] begin transaction

2009-11-23 Thread Pavel Ivanov
> what is interesting is that proc B's 'item not found in locker!' is a read > operation. so possibly i've (inadvertently) hit the 'shared lock upgrade to > reserved lock' immediate fail. > > thoughts? Did you reset/finalize statement after this read operation? Do you have any other active

Re: [sqlite] begin transaction

2009-11-23 Thread Tom Broadbent
thanks for the interesting comments. here is the log that (i believe) illustrates the problem: 092250 PID:07E50002 TID:07E60002 PLFS!INFO: attempting to begin IMMEDIATE transaction 092260 PID:04310006 TID:0548000E PLFS!INFO: item not found in locker! 092267 PID:04310006 TID:0548000E PLFS!INFO:

[sqlite] Degradation of indexing speed (some tests)

2009-11-23 Thread Alexey Pechnikov
Hello! There is the problem with indices on medium-size databases. See tests here: http://geomapx.blogspot.com/2009/11/degradation-of-indexing-speed.html Best regards, Alexey Pechnikov. http://pechnikov.tel/ ___ sqlite-users mailing list

Re: [sqlite] begin transaction

2009-11-23 Thread Pavel Ivanov
> That's true, but the comment is a bit deceptive, In this > particular case SQLite is supposed to invoke the busy-handler. What > should happen is that SQLite grabs the SHARED lock then fails to get > the RESERVED. But in this case SQLite is smart enough to know that > it can release the SHARED

Re: [sqlite] begin transaction

2009-11-23 Thread Dan Kennedy
On Nov 23, 2009, at 9:26 PM, Pavel Ivanov wrote: > According to SQLite sources: > > ** The pager invokes the busy-handler if sqlite3OsLock() returns > ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, > ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE > **

Re: [sqlite] begin transaction

2009-11-23 Thread Pavel Ivanov
According to SQLite sources: ** The pager invokes the busy-handler if sqlite3OsLock() returns ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE ** lock. It does *not* invoke the busy handler when upgrading from

Re: [sqlite] begin transaction

2009-11-23 Thread O'Neill, Owen
Hi Tom, Whilst not knowing much about the process, I have a recollection about something in the documentation that said if sqlite thought that there was a potential for deadlock the busy handler was never even called. Could that explain this ? Cheers Owen -Original Message- From:

Re: [sqlite] Set error message within virtual table implementation?

2009-11-23 Thread WClark
> Yes, see the zErrMsg member: > > http://sqlite.org/c3ref/vtab.html Thank you! So simple, and I missed it ;o) Will ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Problem with database (SELECT hangs)

2009-11-23 Thread Jens Miltner
Am 21.11.2009 um 04:48 schrieb Phil Longstaff: > sqlite> explain query plan SELECT DISTINCT t.* FROM transactions AS > t, splits > AS s WHERE s.tx_guid=t.guid AND > s.account_guid='e3ea8186deb3a9c160ab3b9409ea618f'; > 0|0|TABLE transactions AS t WITH INDEX > sqlite_autoindex_transactions_1