[Gpe-list] libeventdb readonly support

Graham Cobb g+gpe at cobb.uk.net
Tue Jun 24 17:39:21 CEST 2008


I have just checked in some changes to libeventdb to add the concept 
of "readonly" access to the event database.

This is necessary to fix a problem with the new gpesummary code: if two 
applications both open the event DB they interfere with each other due to the 
caching that libeventdb does.  In particular, even if one of them makes no 
changes to the database, libeventdb updates the unacknowledged alarms list 
from both processes and things go wrong (e.g. if the alarm is acknowledged in 
gpe-calendar, gpesummary can overwrite the status causing it to appear 
unacknowledged again).

The change is the addition of a new function: event_db_readonly.  This works 
in exactly the same way as event_db_new (it takes the same arguments and 
returns the same results) except that it marks the database as read only.  It 
will not create the database or convert it: if it doesn't already exist at 
the current version level it returns an error.  Note: I have also increased 
the version number of the library.  

libeventdb will not make any automatic (behind the scenes) changes to a 
readonly database (such as marking events as unacknowledged).  Any attempt by 
the calling application to make changes to a read only database (e.g. by 
setting event attributes or creating or deleting events) will result in an 
assertion failure in the libeventdb code.

How do I arrange to update the documentation to add the new function?  Is the 
only API documentation still the stuff in 
http://www.kernelconcepts.de/~fuchs/gpe/doc/?

Graham



More information about the Gpe-list mailing list