-
Bug
-
Resolution: Done
-
Major
-
7.1.3.Final (EAP), EAP 6.1.0.Alpha (7.2.0.Final)
-
None
Having a lot of resource adapters configurations, I noticed that sometimes e connection definition/admin object missed one o more config properties (this also led to a further worse problem caused by another bug that I'm also going to report)
I reproduced it and the problem is caused by the configProperties HashMap in org.jboss.as.connector.subsystems.resourceadapters.Modifiable
{AdminObject|ConnDef}.java that is accessed by multiple model operations at the same time.
I fixed it transforming the HashMap in a ConcurrentHashMap.
I also noticed that in the past a similar fix was made in ModifiableResourceAdapter where the add* method where made synchronized (probably because the HashMaps are inherited by the classes in IronJacamar).
Maybe instead of the ConcurrentHashMap a synchronized addConfigProperty (and maybe getConfigProperties) can be used instead.
My doubt is that I don't known if a ConcurrentHashMap/synchronized methods are enough or also the reads need to be synchronized. From what I see looks like the other method getConfigProperties is called after all the configProperties are added.
I'm going to attach a pull request with a possible patch that uses a ConcurrentHashMap.
Thanks!