Another alternative might be using an API that waits for events on the
database file - for instance kqueues some unix variants or
WaitForMultipleObjects and
FindFirstChangeNotification/FindNextChangeNotification on windows. 

I agree that polling causes issues.  It doesn't require much CPU if you
use the right query, but it may access the disk, and it may interfere
with OS power management.
 
Pat

-----Original Message-----
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 29, 2006 6:50 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] real time gui updates

In that case you might use some form of inter-process communication like

a named pipe or a semaphore which is activated by a change to the DB. 
The viewing process would have a thread waiting on the IPC channel or 
semaphore.  When the DB changed it would automatically trigger a refresh

in the viewer process/processes.

If you were ambitious you could write an Sqlite function to perform the 
synchronization and drive it from a trigger.  That would make the logic 
simpler in your application.

Rob Menegon wrote:
> Not sure whether I understand how this would occur.  
> 
> The application is not doing or responsible for the updates to the
database.
> Its only function in life is to retrieve and display data. Updates,
> modifications occur via another application, so I was incorrect in my
> previous response to you - one user (app) doing updates and another
> displaying data - independent processes.
> 
> 
> 
> -----Original Message-----
> From: John Stanton [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 29 June 2006 2:51 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] real time gui updates
> 
> In that case your application knows whenever the database is changed
and can
> call a refresh routine.
> 
> Rob Menegon wrote:
> 
>>No a single user/instance of the application reading from the
database. 
>>
>>
>>
>>-----Original Message-----
>>From: John Stanton [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, 28 June 2006 10:45 PM
>>To: sqlite-users@sqlite.org
>>Subject: Re: [sqlite] real time gui updates
>>
>>Rob Menegon wrote:
>>
>>
>>>I have an application that displays data retrieved from various
SQLite 
>>>tables.  As the data within the tables changes I want these changes 
>>>reflected in the application real time.
>>>
>>>Can someone advise on the best way of doing this?
>>>
>>>Rob Menegon
>>>
>>>
>>
>>Do you have multiple independent users?
>>
> 
> 
> 

Reply via email to