Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: Is abap thread safe? Some question in Singleton pattern in ABAP

$
0
0

Steve,

 

 

 

I've the same question, few days ago I tried to use the singleton in ABAP. In Java programming is possible to use the same reference in two sessions or programs, sharing attributes, methods and all data, but I could not do in ABAP.

 

 

 

 

 

 

In my test I created a program with one global class using the singleton pattern, so I expected that when I run my program and see the reference returned after the get_instance method it should be equal to the same program run in another session, but the ABAP will create a new reference and instantiate again.

 

 

 

 

 

 

So I deduced that the only way to share it between sessions in ABAP is using the ABAP Shared Memory Objects.

 

 

 

 

I can be wrong, but I think that ABAP use a thread by user session (Each window) and we can't change it.

 

 

Best regards.


Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>