Alexander Smirnoff wrote:
> 
> O-o, I've missed the wall... Sorry for stupid question...
> 
> But I have possible candidate for another one:
> 
> In my application I have  heavily relly on database connection pool. I've
> look into xsp esql file and see that the way you get Database Connection is
> via DataSourceComponent select method. So I don't have to use
> JdbcConnectionPool directly? How all working behind JdbcDataSource? Are any
> monitoring options exist?


Correct.  The Cocoon.xconf file has an entry to describe multiple datasources,
and get the pool of connections by name.  Once your Component is Composed
(i.e. implements Composable and receives the ComponentManager), you can lookup
the following role:

ComponentSelector selector =
    (ComponentSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");

DataSourceComponent datasource = (DataSourceComponent) selector.select("poolname");
Connection conn = datasource.getConnection();

// ... do your stuff

conn.close();



As to monitoring options, there is a keepalive query that happens behind the scenes.
It performs a quick query to see if the connection is still open.  Beyond that, there
isn't anything else at this point.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to