cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Yates <>
Subject Re: Transformer initialization
Date Tue, 22 Apr 2003 14:01:20 GMT
 Hello Rajeev
    I don't know about ldap, but if you want to use a database 
connection in your transformer, just have it implement Composable and 
you will have access to a DataSourceComponent from which you can get a 
connection from a pool which is configured in cocoon.xconf. There are 
abstract classes in the transformation package which implement 
Composable that you can extend.

private ComponentManager myManager;

public void compose(ComponentManager aManager) throws ComponentException {
    myManager = aManager;

private doTransformationStuff() throws Exception {
    DataSourceComponent source =
        (DataSourceComponent) myManager.lookup(DataSourceComponent.ROLE);
    Connection conn = source.getConnection();
   // ........

Rajeev Gupta wrote:

>I want to have a custom database/ldap transformer with all the queries  on
>the same connection.
>That connection may be made in the init method of CocoonServlet (or any
>other option?).
>That same connection will be used by  the custom transformer and will be
>destroyed only when CocoonServlet is destroyed.
>Any suggestion?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message