scalar-labs / btm

JTA Transaction Manager
Apache License 2.0
426 stars 151 forks source link

Resolution of the issue #104 XAFactories which implement java.util.Map (MQXAConnectionFactory) cannot be initialized properly #105

Closed tomasjura closed 5 years ago

tomasjura commented 5 years ago

one additional fix : do not print passwords into log

lorban commented 5 years ago

Sweet, I mistakenly force-pushed an old version onto the master (wrong script, wrong folder, fat fingers) instead of updating my local repo.

Once I've fixed this mess, you're going to need to rebase this PR.

Regarding your change, my first opinion is that you made something quite substantial which looks to have a much broader scope than the original Map problem. I would very much prefer to stick to the very narrow original scope here, if you'd like to experiment more I would encourage you to do so in your own fork.

Thanks and sorry for the mess.

tomasjura commented 5 years ago

I rewrote just one function: PropertyUtils.setProperty. The orginal (and preserved) design of that function suffers with several corner cases (related to ClonedProps), which lead IMO to unsolvable problems. The cases are described in the comment of that function. I tried to handle them as best I could ( - code do not call setters when they don't exists ), but still the call of setters along the property path is a heuristics which may fail for some obscure cases. The solution of original Map problem just show those cases in full range and there was no other way than the complete rewrite of setProperty function.

lorban commented 5 years ago

Sorry for the long delay getting back to you. You haven't rebased your branch on top of the master, so this makes reviewing your PR rather complicated.

In any case, I would encourage you to make your changes in your own fork as I do not have the time anymore to maintain BTM, let alone review PRs in a timely manner.

Sorry & good luck with your customizations.

tomasjura commented 5 years ago

I hope I did it correctly. At least on the github web page it seems to be merged. Now I fighting with the XA session init. Basically I'm writing the JMS consumer in the Tomcat. But the DualSessionWrapper do not returns the XASession, unless XA transaction is started, and do not supports createXASession (why? Shouldn't it implement XASession?).