Regarding the CMR, I was pointing to all the JTAEnvironmentBean CMR getters which provides the direct instance of the configured object, ie.https://github.com/jbosstm/narayana/blob/5.10.4.Final/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L1201https://github.com/jbosstm/narayana/blob/5.10.4.Final/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L1147https://github.com/jbosstm/narayana/blob/5.10.4.Final/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L1056I think those ones should be considered for using the copy-constructor of the returned collections.
Regarding the first part of my question - returning a copy of map of mutable objects - I assume this was designed with consideration of implications of such state.
OndraOn Tuesday, June 2, 2020 at 6:08:58 PM UTC+2, Tom Jenkinson wrote:Which element of CMR concerns you here? I think we would need to inspect the code in greater depth to understand if there is a problem with those getters that do not wrap in a new collection need to do that.
On Tuesday, June 2, 2020 at 3:46:01 PM UTC+1, Ondra Chaloupka wrote:Hi,recently we have've got a discussion about integration of Narayana with Agroal and we've got to a discussion about Narayana thread safety of the getters in the Narayana EnvironmentalBeans. I would like to check here if it's something to concern about or not at all.Basically, the environment beans (e.g. JTAEnvironmentBean - https://github.com/jbosstm/narayana/blob/5.10.5.Final/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L51) use a collections to store configuration properties. For example list of XAResourceRecoveries. The setter and getter are synchronized and the setter returns the copy of the Collection but the objects themselves (returned inside of the Colletion) could be mutable. Beside that there are some getters which return directly the created collection without the use of the copy constructor.I limited my initial investigation only for JTAEnvironmentBean and I can see the returning of the collection of the mutable objects consist either recovery functionality or cmr functionality.The recovery processing takes the lists everytime when recovery cycle starts. Despite the objects are mutable it seems quite safe to me.For CMR functionality I'm not so sure.I would like to check with you if this was somehow considered and/or if it's something that could be potential issue (if so how to approach it)?ThanksOndra
You received this message because you are subscribed to the Google Groups "narayana-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to narayana-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/narayana-users/038212b6-6dd7-4f0f-900c-54390c85528f%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/narayana-users/ee4672b2-b32c-486c-9d96-48dc46ecfc5bn%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/narayana-users/1b8d4f9c-809f-4a8c-9d88-4c6054fd5b9dn%40googlegroups.com.