Philip Herbst created OPENEJB-2027:
--------------------------------------

             Summary: @DataSourceDefinition with custom properties are not 
working
                 Key: OPENEJB-2027
                 URL: https://issues.apache.org/jira/browse/OPENEJB-2027
             Project: OpenEJB
          Issue Type: Bug
          Components: configuration, deployment
    Affects Versions: 4.5.1
            Reporter: Philip Herbst


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





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to