<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Singleton in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248177#M1985860</link>
    <description>&lt;P&gt;I think this is possible. Found some pointers here&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencreate_shared_object_abexa.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencreate_shared_object_abexa.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As per sample program i will point the root-oref to my class type.&lt;/P&gt;&lt;P&gt;At least the report program is working. I need to test it with the actual HTTP requests coming into ABAP system.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Aug 2020 14:33:54 GMT</pubDate>
    <dc:creator>former_member210955</dc:creator>
    <dc:date>2020-08-22T14:33:54Z</dc:date>
    <item>
      <title>Singleton in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248174#M1985857</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I am looking to make a ABAP class "A" singleton in ABAP.&lt;/P&gt;
  &lt;P&gt;I can not just rely on the usual singleton pattern implementation in ABAP memory because each HTTP requests incoming to ABAP have a new session. So the singleton with plain memory will not work.&lt;/P&gt;
  &lt;P&gt;I explored shared memory and then found that we can put object instances in shared memory.&lt;/P&gt;
  &lt;P&gt;I am getting the following exception CX_SHM_EXTERNAL_REFERENCE&lt;/P&gt;
  &lt;P&gt;As per &lt;A href="https://answers.sap.com/questions/6058360/shared-objects-cxshmexternalreference-exception.html"&gt;https://answers.sap.com/questions/6058360/shared-objects-cxshmexternalreference-exception.html&lt;/A&gt; and &lt;A href="https://answers.sap.com/questions/12905922/sharing-runtime-objects-to-shared-memory-using-shm.html"&gt;https://answers.sap.com/questions/12905922/sharing-runtime-objects-to-shared-memory-using-shm.html&lt;/A&gt; it seems this is not possible to keep objects in memory.&lt;/P&gt;
  &lt;P&gt;Best Regards,&lt;/P&gt;
  &lt;P&gt;Saurav&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 07:21:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248174#M1985857</guid>
      <dc:creator>former_member210955</dc:creator>
      <dc:date>2020-08-22T07:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248175#M1985858</link>
      <description>&lt;P&gt;Is your goal to have a stateful HTTP session? Why can't you reinstantiate the object? Modern usage is to have a stateless/REST one. Maybe you should explain the whole context to get more precise help. Moreover, be careful that you may also have several application servers, i.e. different memories...&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 09:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248175#M1985858</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-08-22T09:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248176#M1985859</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I have a fiori application which connects to ABAP. backend which connects to an external service through OAuth mechanism.&lt;/P&gt;&lt;P&gt;Constructor of the class does some initialisation for connection to this external service like communicate using OAuth.&lt;/P&gt;&lt;P&gt;I don't want all the subsequent requests to go through this initialisation code each and every time. &lt;/P&gt;&lt;P&gt;Hence wanted to make this class singleton across the HTTP requests coming from the Fiori application&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Saurav&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 09:53:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248176#M1985859</guid>
      <dc:creator>former_member210955</dc:creator>
      <dc:date>2020-08-22T09:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248177#M1985860</link>
      <description>&lt;P&gt;I think this is possible. Found some pointers here&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencreate_shared_object_abexa.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencreate_shared_object_abexa.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As per sample program i will point the root-oref to my class type.&lt;/P&gt;&lt;P&gt;At least the report program is working. I need to test it with the actual HTTP requests coming into ABAP system.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2020 14:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248177#M1985860</guid>
      <dc:creator>former_member210955</dc:creator>
      <dc:date>2020-08-22T14:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248178#M1985861</link>
      <description>&lt;P&gt;Is the external services called inside of a code-based OData service? If it is, then &lt;A href="https://blogs.sap.com/2014/10/14/how-to-use-soft-state-support-for-odata-services/"&gt;soft state&lt;/A&gt; should be a better solution then persistence objects. &lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 19:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-in-abap/m-p/12248178#M1985861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-09-06T19:25:03Z</dc:date>
    </item>
  </channel>
</rss>

