[ Previous ] [ Contents ] [ Index ] [ Next ]



Get multiple database handles from pool with timeout


    int Ns_DbPoolTimedGetMultipleHandles(
    Ns_DbHandle **handles,
    char *poolname,
    int nhandles,
    int timeout


The Ns_DbPoolTimedGetMultipleHandles function gets multiple database handles from the pool specified by poolname and returns an array of handles (handles). If all of the specified number of handles (nhandles) are not available, the function waits until they are, depending on timeout. If a timeout is not specified or timeout is zero, it will wait indefinitely (perhaps forever) for the handles to become available. If timeout is greater than zero, it will either return with the handles within that time period, or return "" if the time period was exceeded. If timeout is less than zero, it will not block.

It returns NS_OK if all requested handles are returned, NS_TIMEOUT if the attempt timed out, or NS_ERROR on an error condition. You must request all the database handles you will need for a specific pool with one call to Ns_DbPoolTimedGetHandle (if you need only one handle) or Ns_DbPoolTimedGetMultipleHandles (if you need more than one handle). You must release all your database handles explicitly (with Ns_DbPoolPutHandle) before acquiring more.

See Also


Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.