Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1394

DI-based replacement for JNDI hack

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1M1
    • 3.1M1
    • Core Library
    • None

    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.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: