You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Dumindu Pallewela <du...@wso2.com> on 2007/06/05 00:13:51 UTC

Sharing an object between successive requests.

Oops, I sent the email with a wrong subject. Forwarding the corrected.

-------- Original Message --------
Subject: Re: make use of fs ACLs

Hi all,

In a module that I am writing, I need to share an object between
successive requests. My first go at it was to have a reference to this
object in the server configuration. But only after trying it out I found
that the server configuration is not shared between the child processes,
rather each process has it's own server configuration. (I want the
module to work despite the MPM used.)

So my question is how can I share an object between successive requests?

Thanks,
Dumindu.


Re: Sharing an object between successive requests.

Posted by Dumindu Pallewela <pa...@gmail.com>.

César Leonardo Blum Silveira wrote:
> Depending on what you want to do, DBM may fit your needs:
> 
> http://apr.apache.org/docs/apr-util/0.9/group__APR__Util__DBM.html
> 


Hi Tim, Leonardo,

Thanks for the suggestions. I managed to get persistent storage working 
for my module with SDBM. It seems to me that shared memory (which I 
first tried to use) is too much of painful work and this module doesn't 
need that sort of functionality anyway for the time being.

-Dumindu.

Re: Sharing an object between successive requests.

Posted by César Leonardo Blum Silveira <ce...@gmail.com>.
Depending on what you want to do, DBM may fit your needs:

http://apr.apache.org/docs/apr-util/0.9/group__APR__Util__DBM.html

-- 
César L. B. Silveira
http://cesarbs.wordpress.com/

On 6/4/07, Dumindu Pallewela <du...@wso2.com> wrote:
> Oops, I sent the email with a wrong subject. Forwarding the corrected.
>
> -------- Original Message --------
> Subject: Re: make use of fs ACLs
>
> Hi all,
>
> In a module that I am writing, I need to share an object between
> successive requests. My first go at it was to have a reference to this
> object in the server configuration. But only after trying it out I found
> that the server configuration is not shared between the child processes,
> rather each process has it's own server configuration. (I want the
> module to work despite the MPM used.)
>
> So my question is how can I share an object between successive requests?
>
> Thanks,
> Dumindu.
>
>

Re: Sharing an object between successive requests.

Posted by Dumindu Pallewela <pa...@gmail.com>.
On 6/5/07, Tim Bray <Ti...@sun.com> wrote:
> >
> > So my question is how can I share an object between successive
> > requests?
>
> Well, that is persistent storage.  Common tools for this include the
> filesystem, mmap'ed storage, and databases.  Remember that apache
> could suddenly go away between any two requests.  -Tim

Thanks Tim. It would be great if you can provide me with pointers to
some examples to such usages in apache modules.

Additionally, I want to give the user the choice whether to use a
persistent storage or not. That's why I was looking for a shared
memory alternative too.

Dumindu.

Re: Sharing an object between successive requests.

Posted by Tim Bray <Ti...@Sun.COM>.
On Jun 4, 2007, at 3:13 PM, Dumindu Pallewela wrote:

> In a module that I am writing, I need to share an object between
> successive requests. My first go at it was to have a reference to this
> object in the server configuration. But only after trying it out I  
> found
> that the server configuration is not shared between the child  
> processes,
> rather each process has it's own server configuration. (I want the
> module to work despite the MPM used.)
>
> So my question is how can I share an object between successive  
> requests?

Well, that is persistent storage.  Common tools for this include the  
filesystem, mmap'ed storage, and databases.  Remember that apache  
could suddenly go away between any two requests.  -Tim