Gerard van de Looi <[EMAIL PROTECTED]> wrote:
> I was thinking, but maybe it would be nice to use some kind of semaphore for
> this construction.
> So I found an implementation on the net of a Dijkstra semaphore. This
> semaphore controls the
> access to a pool of resources. The code looks very solid to me. All you have
> to do is to call aquire()
> before the connection is retrieved from the pool and release() when it is
> put back.
> (When the pool grows is also needs a release()).
>
> Since this was some example code I think no one will care if we put it in a
> MMBase package.
> This will make the code somewhat cleaner I think.
I think you are right. I put 'DijkstraSempahore' in org.mmbase.util, and
cleaned a lot of stuff away in MultiPool by using it.
Perhaps you and Marcel can review/test the code?
The whole stuff can be avoided by use of the hack of Eduard of course. With
jdbc.xml:
<classfile>org.mmbase.module.database.Naming</classfile>
<properties>
<property name="context">java:comp/env</property>
<property name="datasource">jdbc/MMBase</property>
</properties>
But I don't know if the connections are pooled in the app-server. Perhaps
yes? In that case our MultiPool stuff can be considered more or less
deprecated anyway. But no comparating tests are done, so MultiPool must work
too, so we can choose..
Michiel
--
Michiel Meeuwissen
Mediapark, C 107 tel. +31 (0)35 6772979