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".
Andrus
[1] http://cayenne.apache.org/doc/using-jndi.html