[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Db pool [was: My little comments to CPP code]
Forgot to add, see below...
>>> Whenever we call libdm class from servlet it will open DB connection
>>> and
>>> login() stored procedure will be called, b/c libdm classes get uudb&
>>> handle as as an argument to constructor.
>>> After job for this servlet is done, the ~uudb() will close DB
>>> connection
>>> and call logout() stored procedure.
>>>
>> So, what if you have two model-layer classes, that need to perform some
>> related actions on single database connection during single request?
>
> If I implement EnvironmentSetupServlet the way I described above, it won't
> be a problem, since
> 1. Connection will be opened in this servlet init() time.
uuDBPool::getConnection() will be called.
> 2. Servlet' service() will pass DB handle to as many model-layer classes
> as needed.
> 3. Connection will be closed in this servlet destroy() time.
uuDBPool::releaseConnection() will be called.
>
>
>>
>> --
>> Ilya A. Volynets-Evenbakh
>> Total Knowledge. CTO
>> http://www.total-knowledge.com
>>
>>
>
>
>