Re: [ROOT] [Carrot] Persistant Object in Apache

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Wed Apr 03 2002 - 14:58:36 MEST


 Hi Ashley,

Ashley Cambrell wrote:

> Hi Valeriy,
>
> Is there any mechanism that's already part of Carrot to cache TObjects
> across all Apache instances?  For things like persistant (pooled)
> database connections and the like. (sessions?).
>

Currently there is no such mechanism. Such mechanism would be based
on sharing objects in TMapFile. However I failed to use libNew and
TMapFiles with Carrot ( I'll look at this problem again).

Another solution would be using TFile with file-locking or with semaphores.
As a starting point would be implementaion of lock ing Carrot serever-side caching.
Can found at Carrot_Dir/module/TApacheCache.cxx


>
> I have gone through the source and I can't seemed to find anything that
> looks like it.  The only thing that look like it could be the same
> object across all backend is the global gApacheBrowser.  (Is
> gApacheBrowser the same object under all backends?)

Not. All global instances (like gDirectory, gROOT, gApacheBrowser etc)
are not shared and are different for each apache subprocesses

>
> If there isn't already a mechanism in place, [is it possible and] would
> there be any argument against adding a TMap like caching object that
> scripts could store TObjects in? (key being perhaps "sessionid" like
> PHP, and the value being another TMap like object to store client
> specific session data)

There is shared memory module for apache
http://www.engelschall.com/sw/mm/
probably using of this module along with redefining new/delete operators
would make it possible. Need to be investigated.

Regards.    Valeriy



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:47 MET