UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UU code



sergey@total-knowledge.com wrote:
> I have a DB pool created in my libdm/uudb.cpp class. Now I need to save
> pointer to it in ServletContext.
> In my understanding saving in ServletContext means setting request
> attribute.
That's clearly a misunderstanding, as request attributes only live
as long as request does.
>  Since my DB handle created in uudb costructor, I don't know how
> to link it with request.
>   
Servlet has a virtual init() method, that you can override. There you
can create your pool instance and store it in ServletContext attribute.
> Is it a right idea? Any examples in cppserv or sptk which have a similar
> functionality?
>
>   
>> Each servlet lives in ServletContainer, which, in turn, lives in
>> ServletContext
>> ServletContext joins multiple servlets, allowing them to share some data.
>> What I would do, is create that pool, and store pointer to it in
>> ServletContext
>>
>> --
>> Ilya A. Volynets-Evenbakh
>> Total Knowledge. CTO
>> http://www.total-knowledge.com
>>     

-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


Authoright © Total Knowledge: 2001-2008