cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreading and variables

0 Kudos

Hi,

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,

Philippe

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185280
Active Contributor
0 Kudos

Philippe,


As far as I know there isn't anything out of the box. I have found pushing this sort of thing to a database to be the simplest solution. e.g. oracle sequence+trigger but it's been a while.

Regards,
Christian