Closed tmorin closed 8 months ago
We are just experiencing a similar issue with the affinityDomain. This one is also shared in the ConvenienceCommunication class. We faced an error which occured as we wanted to write while another transaction was reading leading to the write operation utilising the read endpoint.
I would however not recommend your proposal to set the scope to prototype. While this solution might work, it will heavily impact the memory as the convenience communication is a heavy weighted bean due to extending the CamelService.
We are in contact with eHS and will keep you updated on a suitable solution.
solved
Hi,
We are using
ConvenienceCommunicationCh
to submit document to a Document Registry.We have concerns about the field
ConvenienceCommunication#txnData
.As far we understood, the instance of the field should work only for a single interaction with the Document Registry/Repository.
However, the Spring Bean Scope of
ConvenienceCommunicationCh
is Singleton.Therefore, in multi threaded environment, i.e. basic Spring Boot App with REST services, the instance of the
txnData
field will be shared among many concurrent requests.This will lead to unexpected changes of the
ConvenienceCommunication#txnData
from REST request point of view, and therefore failures.Is my understanding correct?
Shouldn't we prevent concurrent access setting the Prototype Spring Bean Scope for
ConvenienceCommunication
andConvenienceCommunicationCh
?Best regards