[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: need to read an entry from the db after reading config file



At 02:49 PM 4/26/2004, Forest Hill wrote:
>I'd like to store some config info in the database, with a directive in the config file indicating where to look for that config info. So, I need to search for the entry containing that data after read_config() finishes, but before the server finishes starting up.

Assuming the configuration information is database specific, then
one can do the search as part of the db_open().  If its overlay
specific, I believe one can overlay a db_open to do the search in.
If the configuration information is global, then you just need
to hack the startup to do additonal stuff post read_config()
but prior to starting the listener thread.

In regards to your second question, one just needs to construct
a pseudo-Operation to do the search under.  There are a number of
examples of such in the code.

Have fun! Kurt
 
>The problems I'm having are
>
>1) I'd like to do this search synchronously if possible since I really don't want the server to start answering queries until after I'm done doing this
>
>2) all of the search functions seem to require an Operation* and this is not happening as part of some other operation.  is there a designated ctx and/or Operation* already available for doing this type of thing?
>
>Is there somewhere in the code where a lookup is being done synchronously and not as part of some larger user-requested Operation* ?
>
>Thanks!
>-- 
>
>Forest Hill
>Apple Computer, Inc.
>408-329-4442
>forest@apple.com