cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Yates <ceya...@stanford.edu>
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();
    myManager.release(source);
   // ........
    conn.close();
}


Rajeev Gupta wrote:

>Hi,
>
>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?
>
>-Rajeev
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message