Re: [Sqlrelay-discussion] sqlrelay-0.36
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2005-04-01 04:34:23
|
Chris, PHP provides a resource list and cleanup framework. The new sqlrelay PHP API uses it. Whenever sqlrcon_alloc or sqlrcur_alloc is called, it creates an instance of the sqlrconnection or sqlrcursor C++ class and puts it in the resource list for the PHP module. Those functions return a list id rather than returning the instance itself now. Each of the sqlrelay functions take the id, look up the instance in the "resource list" and use it. The sqlrcon_free and sqlrcur_free functions look up the instance in the list, remove it from the "resource list" and delete it. When a page is done (either aborted or terminated normally) PHP runs through a cleanup process where it goes through it's resource list, calling whatever cleanup function is registered for each item in the list. The sqlrelay module registers cleanup functions that delete the sqlrconnection or sqlrcursor instances now. So, you can use the sqlrcon_free or sqlrcur_free methods, you can register shutdown handlers that use them. All that will still work, but you don't have to anymore. I need to update the docs :) Dave dav...@fi... On Thu, 31 Mar 2005 15:46:28 -0800 "Chris Falk" <Ch...@si...> wrote: > Hi David, > > > > I'm just going through the changelog for 0.36. Two of the points are > great news for us! The 0 connections fix and the change to the php > API for sqlrcon/cur_free. I understand the 0 connections issue, as it > was a constant problem for us with our firewalls killing the initial > connection during periods of inactivity. > > > > However, could you elaborate on why we no longer need to call > sqlrcon/cur_free anymore? How are the connections and cursors cleaned > up automatically now? It looks like the docs still state that these > functions must be called to ensure resources are freed up. We have a > php function that we register for shutdown that cleans up all > resources at the end of the php request processing. Do we still need > this function with 0.36? > > > > Thanks! > > Chris > > > > Chris Falk > Senior Software Engineer > siberra > DIGITAL MEDIA SYSTEMS > Tel: 604-696-3224 > Fax: 604-696-3201 > ch...@si... <mailto:ch...@si...> > www.siberra.com <http://www.siberra.com/> > > > > > The information in this e-mail message including any attachments is > intended only for the named recipients above and may contain > confidential or privileged information. If you have received this > message in error, or are not the named recipient(s), please > immediately notify the sender by replying to the message and deleting > all copies of it from your computer. > > Ce courriel de meme que toute piece jointe s'adresse seulement au(x) > destinataire(s) designe(s) et peut contenir des renseignements > confidentiels ou privilegies. Si vous avez recu ce message par erreur > ou que vous n'etes pas un destinataire designe, veuillez avertir > immediatement l'expediteur en repondant au message et effacez-en > toutes les copies dans votre ordinateur. > |