[ https://issues.apache.org/jira/browse/TOMEE-2157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16306330#comment-16306330
]
Raymond Chen commented on TOMEE-2157:
-------------------------------------
Hi Romain, could you point me to the document or jira with this logic? It seems confusing
to me. Is there an option to turn it off?
> Resource lookup in tomee.xml always returns the first one when there is no match
> --------------------------------------------------------------------------------
>
> Key: TOMEE-2157
> URL: https://issues.apache.org/jira/browse/TOMEE-2157
> Project: TomEE
> Issue Type: Bug
> Components: TomEE Core Server
> Affects Versions: 7.0.2
> Reporter: Raymond Chen
>
> I have a resource definition in my tomee.xml like this:
> {code:xml}
> <Resource id="jdbc/MyDatasource" type="javax.sql.DataSource">
> jdbcDriver = com.microsoft.sqlserver.jdbc.SQLServerDriver
> jdbcUrl = jdbc:sqlserver://localhost:1433;databasename=mydb;SelectMethod=cursor
> jtaManaged = false
> password = password
> userName = sa
> validationQuery = SELECT 1
> validationInterval = 30000
> testOnBorrow = true
> </Resource>
> {code}
> The resource reference in my web.xml is like this:
> {code:xml}
> <resource-ref id="ResourceRef_MyJDBC">
> <description>
> </description>
> <res-ref-name>jdbc/MyDatasource</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
> {code}
> Everything is working well so far. But I discovered lately that if I change the id of
the resource in tomee.xml, like to "jdbc/WhateverName", it still works. When I put more resource
nodes in tomee.xml, I found actually it always returns the first resource if there is no match
in the lookup. If there is a match, it returns the matched resource.
> The behavior seems strange to me. Shouldn't it report an error if not matching resource
is found?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
|