You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2014/05/01 14:21:16 UTC

[jira] [Resolved] (OPENEJB-2027) @DataSourceDefinition with custom properties are not working

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

Romain Manni-Bucau resolved OPENEJB-2027.
-----------------------------------------

    Resolution: Fixed

> @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
>            Assignee: Romain Manni-Bucau
>             Fix For: 4.6.0
>
>
> 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 was sent by Atlassian JIRA
(v6.2#6252)