cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <tcu...@dff.st>
Subject db connection definition (was: cache and performance)
Date Sun, 09 Jul 2000 15:34:41 GMT
> Yes. There are two parts to this, if I understand your question
> correctly -
> avoiding repeating opening the connection for each page, and avoiding
> actually _specifying_ the connection name on each page. For the
> first, there
> are a number of free connection pooling classes out there - try a
> search on
> http://dmoz.org or http://www.metacrawler.com . It's a very common
> requirement - in fact, there is connection pooling built in to the latest
> javax.sql package, IIRC.

As I know now... there's also one in the new turbine shapshot
which will (hopefully) soon be integrated into cocoon1.

Right, Donald? ;-)

> The second can be done completely invisibly, thanks to XSP. If you have a
> Servlet 2.2 API-compatible servlet runner, insert a parameter
> like this into
> your web.xml:
>
>     <context-param>
>       <param-name>dbconnection</param-name>
>       <param-value>testCart</param-value>
>       <description>
>         The database connection name passed to DBConnectionManager.
>       </description>
>     </context-param>
>
> (The format of the web.xml file is part of the Servlet 2.2 API
> specification, so it should be the same for all compatible
> servlet runners).

Hm... so this web.xml file is supposed to be a config file
from my Servlet runner?

[snip]

I think that's a good idea... Why not having all the used
connection definitions defined in file specified in the
cocoon properties and then you can just refer to them
by name from the sql processor...


> If you don't have a Servlet 2.2 API-compatible servlet runner,
> you can still
> do the same thing by implementing a singleton class to hold the "global"
> configuration details like the connection name.

Thanks for the extensive answer!!
--
Torsten


Mime
View raw message