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

@DataSourceDefinition with custom properties are not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.5.1
    • 4.6.0
    • configuration, deployment
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: