cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: query_governor_cost_limit setting not working with cayenne?
Date Sun, 21 Dec 2008 14:34:09 GMT

On Dec 21, 2008, at 4:16 PM, KathyS wrote:

> Related question, if you have time. How can I hook onto connection  
> creation
> in the pool? I'd love to be able to run the "set ..cost" statement  
> for each
> new connection.

This is also fairly straightforward. Cayenne uses a  
javax.sql.DataSource object to obtain connections. In many cases  
DataSource is provided by the environment (e.g. webapp containers or  
appservers) [1], so you can check the docs of you container on how to  
install a custom DataSource there.

In cases when Cayenne manages its own DataSource (i.e. if you selected  
"org.apache.cayenne.conf.DriverDataSourceFactory" for the DataNode  
"DataSource Factory" in the Modeler), you can supply your own  
DataSourceFactory (also via the Modeler).

FWIW, I won't be surprised if SQLServer JDBC driver would support  
passing something in the URL that would set the "cost".



View raw message