Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAFactories which implement java.util.Map (MQXAConnectionFactory) cannot be initialized properly #104

Open
tomasjura opened this issue Jun 25, 2019 · 3 comments

Comments

@tomasjura
Copy link

XAFactories which implements java.util.Map (for example com.ibm.mq.jms.MQXAConnectionFactory), cannot be initialized correctly by .properties configuration.
Problem is in the function bitronix.tm.utils.PropertyUtils.setProperty where is

if (currentTarget instanceof Map) { ... }
else { setDirectProperty( ... ) }.

The priority should be IMHO inverse. i.e.

if the property exists then { setDirectProperty(...) } 
else {
  if XAFactory is a map then {
      setup map and log warning about setting value in the Map.
  }
}
@lorban
Copy link
Contributor

lorban commented Jun 26, 2019

Thanks for the report. How about you create a PR with a test and a fix?

@tomasjura
Copy link
Author

I'm working on the fix. Would be nice to have a confirmation that the proposed logic change ( the named property first, maps as the second ) is correct and do not clash with some another processes.
As the first attempt I changed the XAFactoryHelper.java to use the setDirectProperty instead setProperty, but test testBindOneJdbc fails with NPE.

@lorban
Copy link
Contributor

lorban commented Jun 27, 2019

Well, your proposed logic seems reasonable at first look. I unfortunately couldn't tell you if there would be some undesired side-effect out of what the unit test would catch as I haven't worked on it in years.

Please be aware that while I would happily merge your PR, I do not have the means anymore to perform a release to maven central.

tomasjura pushed a commit to tomasjura/btm that referenced this issue Jul 4, 2019
…ap (MQXAConnectionFactory) cannot be initialized properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants