<?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: Shared memory -  Delete instances in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-memory-delete-instances/m-p/4395532#M1045031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works as designed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quote from documentation for free_instance:&lt;/P&gt;&lt;P&gt;After this method has been executed, all programs where area handles still exist for the released area instance versions are terminated with the SYSTEM_SHM_AREA_OBSOLETE runtime error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why your are using free instance anyway. The invalidation should be sufficient. Also at the beginning of your code, you use detach and detach_commit in succession, detach_commit is enough to close the changing connection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Aug 2008 15:48:54 GMT</pubDate>
    <dc:creator>andre_kster</dc:creator>
    <dc:date>2008-08-28T15:48:54Z</dc:date>
    <item>
      <title>Shared memory -  Delete instances</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-memory-delete-instances/m-p/4395531#M1045030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;data :  text type char10.
text =  'ME'.
data :  val1 type string.
try.
o_area = zcl_mar_area=&amp;gt;attach_for_write(  ).
create object o_sme area handle o_area.
o_area-&amp;gt;set_root( o_sme ).
o_sme-&amp;gt;value = 'TEXT'.
o_area-&amp;gt;detach_commit( ) .
catch cx_shm_attach_error.
endtry.


data :  val1 type string.
try.
    data : hdl type ref to zcl_mar_area,
          root type ref to zcl_mar_shma.
    hdl = zcl_mar_area=&amp;gt;attach_for_read( ).
    val1 = hdl-&amp;gt;root-&amp;gt;value.
*   TRY.
  data : oref   type ref to cx_root,
          text type string,
         text1   type string.

*    itab_fms = hdl-&amp;gt;root-&amp;gt;itab.
catch cx_shm_inconsistent into oref.
        text1 = oref-&amp;gt;get_text( ).
catch cx_shm_change_lock_active into oref.
        text1 = oref-&amp;gt;get_text( ).
catch cx_shm_exclusive_lock_active into oref.
        text1 = oref-&amp;gt;get_text( ).
catch cx_shm_read_lock_active into oref.
        text1 = oref-&amp;gt;get_text( ).
catch cx_shm_no_active_version into oref.
        text = oref-&amp;gt;get_text( ).
if hdl is not INITIAL.
hdl-&amp;gt;detach( ).
hdl-&amp;gt;detach_commit( ).
endif.
*TRY.
 data: rc type shm_rc.
CALL METHOD zcl_mar_area=&amp;gt;invalidate_instance
  EXPORTING
    inst_name         = CL_SHM_AREA=&amp;gt;DEFAULT_INSTANCE
    terminate_changer = ABAP_TRUE
  receiving
    rc                = rc
    .
* CATCH cx_shm_parameter_error .
*ENDTRY.


endtry.
TRY.
CALL METHOD zcl_mar_area=&amp;gt;free_instance
  EXPORTING
    inst_name         = CL_SHM_AREA=&amp;gt;default_instance
    terminate_changer = ABAP_TRUE
  receiving
    rc                = rc
    .
 CATCH cx_shm_parameter_error .
ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting this dump - SYSTEM_SHM_AREA_OBSOLETE&lt;/P&gt;&lt;P&gt;PLease help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 15:30:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shared-memory-delete-instances/m-p/4395531#M1045030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-28T15:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shared memory -  Delete instances</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-memory-delete-instances/m-p/4395532#M1045031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works as designed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quote from documentation for free_instance:&lt;/P&gt;&lt;P&gt;After this method has been executed, all programs where area handles still exist for the released area instance versions are terminated with the SYSTEM_SHM_AREA_OBSOLETE runtime error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why your are using free instance anyway. The invalidation should be sufficient. Also at the beginning of your code, you use detach and detach_commit in succession, detach_commit is enough to close the changing connection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2008 15:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shared-memory-delete-instances/m-p/4395532#M1045031</guid>
      <dc:creator>andre_kster</dc:creator>
      <dc:date>2008-08-28T15:48:54Z</dc:date>
    </item>
  </channel>
</rss>

