Skip to Content
Feb 18, 2016 at 07:59 AM

Multithreading and variables



I have a transaction that generates a unique number. The number is stored in shared memory as a persistent variable. The transaction reads the number into a local variable and immideatly updates the value in shared memory by adding 1. These two assignments are done in the same action block.

It is working 99% of the times. However, In case the transaction is called multiple times by different threads, both threads read the same value from shared memory. The transaction is called from different agent instances in SAP PCO.

In JAVA it is possible to solve this with 'synchronized' variables and methods. Is there any alternative to this in SAP MII?

It is very important for data integrity.

Thank you,