(taking this to dev)

On Dec 20, 2013, at 1:46 AM, John Huss (JIRA) <j...@apache.org> wrote:

> John Huss commented on CAY-1864:
> --------------------------------
> 
> I've got tomcat-jdbc in my project now, so I'm going to try that rather than 
> continue improving PoolManager. One issue I had with integrating tomcat-jdbc 
> is that if you configure your data source using cayenne's properties (like 
> cayenne.jdbc.driver) then it switches your DataSourceFactory to 
> PropertyDataSourceFactory even if you have entered a custom factory in your 
> cayenne.xml file.  I'd suggest that cayenne should only override the factory 
> if it is the default value - XMLPoolingDataSourceFactory.
> 
> As a workaround I renamed my properties (which I am still using).  But it 
> would be nicer to have the same property names and be able to switch 
> connection pool implementations merely by changing the DataSourceFactory.

This is by design. The actual DataSourceFactory, as defined in the ServerModule 
is DelegatingDataSourceFactory:

  binder.bind(DataSourceFactory.class).to(DelegatingDataSourceFactory.class);

The point of which is that the app (or even a deployer) should have an easy way 
to override a factory name specified in XML. 

cayenne.jdbc.* properties are of course intended for 
DelegatingDataSourceFactory/PropertyDataSourceFactory. Are you using these 
properties for something else?

Andrus


Reply via email to