[ 
https://issues.apache.org/jira/browse/CAY-1394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrus Adamchik updated CAY-1394:
---------------------------------

    Description: 
Cayenne up to 3.0 supported emulation of JNDI DataSource for local work based 
on the Modeler preferences (aka "JNDI hack"):

http://cayenne.apache.org/doc30/using-jndi.html

In 3.1, Modeler preferences are implemented differently, using 
"java.util.prefs", and instead of porting the JNDI hack to the new mechanism, I 
will provide a more sensible replacement, based on JVM startup properties. The 
name of the new DS factory  will be PropertyDataSourceFactory. 
PropertyDataSourceFactory will be used to override not only JNDI DataSources, 
but any other DataSource configured in the Modeler.

The property names will be the same as the properties used in unit testing:

http://cayenne.apache.org/running-unit-tests.html

But with a few changes:

* we'll support  dot notation, not capitalized notation. Dot notation is 
traditional Java property naming approach, while capitalized notation was 
introduced to be able to run unit tests on Hudson that breaks on dot notation.
* property names will allow an (optional) suffix with <domain_name>.<node_name> 
to make sure multiple connections can be specified per JVM. 

* cayenne.jdbc.driver[.domain_name.node_name]
* cayenne.jdbc.url[.domain_name.node_name]
* cayenne.adapter[.domain_name.node_name]
* cayenne.jdbc.username[.domain_name.node_name]
* cayenne.jdbc.password[.domain_name.node_name]
* cayenne.jdbc.min.connections[.domain_name.node_name]
* cayenne.jdbc.max.conections[.domain_name.node_name]

At the minimum, cayenne.jdbc.url and cayenne.jdbc.driver must be present for 
the overrides to kick in.

  was:
Cayenne up to 3.0 supported emulation of JNDI DataSource for local work based 
on the Modeler preferences (aka "JNDI hack"):

http://cayenne.apache.org/doc30/using-jndi.html

In 3.1, Modeler preferences are implemented differently, using 
"java.util.prefs", and instead of porting the JNDI hack to the new mechanism, I 
will provide a more sensible replacement, based on JVM startup properties. The 
property names will be the same as the properties used in unit testing:

http://cayenne.apache.org/running-unit-tests.html

Note that we'll support both dot notation and capitalized notation. Dot 
notation is traditional Java property naming approach, while capitalized 
notation was intriduced to be able to run unit tests on Hudson that breaks on 
dot notation. (I guess we can only document dot notation for official use and 
keep capitalized location as an unofficial hack)

* cayenne.jdbc.driver / cayenneJdbcDriver
* cayenne.jdbc.url / cayenneJdbcUrl
* cayenne.adapter / cayenneAdapter
* cayenne.jdbc.username / cayenneJdbcUsername
* cayenne.jdbc.password / cayenneJdbcPassword
* cayenne.jdbc.min.connections / cayenneJdbcMinConnections
* cayenne.jdbc.max.conections / cayenneJdbcMaxConnections

At the minimum, cayenne.jdbc.url and cayenne.jdbc.driver must be present for 
the overrides to kick in.


> DI-based replacement for JNDI hack
> ----------------------------------
>
>                 Key: CAY-1394
>                 URL: https://issues.apache.org/jira/browse/CAY-1394
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 3.1M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>
> Cayenne up to 3.0 supported emulation of JNDI DataSource for local work based 
> on the Modeler preferences (aka "JNDI hack"):
> http://cayenne.apache.org/doc30/using-jndi.html
> In 3.1, Modeler preferences are implemented differently, using 
> "java.util.prefs", and instead of porting the JNDI hack to the new mechanism, 
> I will provide a more sensible replacement, based on JVM startup properties. 
> The name of the new DS factory  will be PropertyDataSourceFactory. 
> PropertyDataSourceFactory will be used to override not only JNDI DataSources, 
> but any other DataSource configured in the Modeler.
> The property names will be the same as the properties used in unit testing:
> http://cayenne.apache.org/running-unit-tests.html
> But with a few changes:
> * we'll support  dot notation, not capitalized notation. Dot notation is 
> traditional Java property naming approach, while capitalized notation was 
> introduced to be able to run unit tests on Hudson that breaks on dot notation.
> * property names will allow an (optional) suffix with 
> <domain_name>.<node_name> to make sure multiple connections can be specified 
> per JVM. 
> * cayenne.jdbc.driver[.domain_name.node_name]
> * cayenne.jdbc.url[.domain_name.node_name]
> * cayenne.adapter[.domain_name.node_name]
> * cayenne.jdbc.username[.domain_name.node_name]
> * cayenne.jdbc.password[.domain_name.node_name]
> * cayenne.jdbc.min.connections[.domain_name.node_name]
> * cayenne.jdbc.max.conections[.domain_name.node_name]
> At the minimum, cayenne.jdbc.url and cayenne.jdbc.driver must be present for 
> the overrides to kick in.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to