Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2027

@DataSourceDefinition with custom properties are not working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.5.1
    • Fix Version/s: 4.6.0
    • Component/s: configuration, deployment
    • Labels:
      None

      Description

      Consider following configuration

      @DataSourceDefinition(
      ...
      properties =

      {"validationQuery= SELECT 1"}

      )

      The value of the property "validationQuery" ends up as "= SELECT 1" which is wrong.

      I tracked down this code in org.apache.openejb.config.AnnotationDeployer#buildDataSourceDefinition
      ...
      for (String s : d.properties()) {
      final String key = s.substring(0, s.indexOf('='));
      final String value = s.substring(s.indexOf('='));
      dataSource.property(key, value);
      }

      The beginIndex of substring is inclusive so the equals sign is included. Perhaps you can also add some trimming of whitespaces to the code

        Attachments

          Activity

            People

            • Assignee:
              romain.manni-bucau Romain Manni-Bucau
              Reporter:
              philip69 Philip Herbst
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: