<?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 Objects issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518287#M569868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about the free area method, are you using the detach_commit method after the update?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jul 2007 00:27:36 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-07-18T00:27:36Z</dc:date>
    <item>
      <title>Shared Objects issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518286#M569867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm experiencing problems using Shared Objects.&lt;/P&gt;&lt;P&gt;My goal was to save in a Shared Memory Area an internal table (defined as an instance attribute of the root class) and then fetch that in another program to update those records in the database.&lt;/P&gt;&lt;P&gt;Unfortunately, the first running program must update the area at every cycle, and that's the problem.&lt;/P&gt;&lt;P&gt;Area is declared with "With versioning" attribute checked.&lt;/P&gt;&lt;P&gt;The generation of the area is done like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
lr_area = zcl_shm_manage_quota=&amp;gt;attach_for_update( 'MANAGE_QUOTA' ).
CATCH .... 
"catching all the cx_shm* exceptions and if something is messed up, I call up the 
"attach_for_write method
lr_area = zcl_shm_manage_quota=&amp;gt;attach_for_write( 'MANAGE_QUOTA' ).
"this is called only in area generation, because if I attach for update, the root
"object is already set up
lr_area-&amp;gt;set_root( lr_root ).
ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an another form, I set up the internal table, using an ad-hoc defined method in the root class, called set_data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
lr_area-&amp;gt;root-&amp;gt;set_data( struc ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And that's done in every cycle of the running program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second program is attaching for read, by using the attach_for_read method, and reads the internal table attribute of the root class, updating its content into the database.&lt;/P&gt;&lt;P&gt;After the update, the area is invalidated and cleared, by this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
lr_area-&amp;gt;free_area( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, at first time, the attach_for_update method fails, and the CATCH structure resolves all by create a new area (or version) by attaching for write. From the second time and over, the attach_for_update method should be ok.&lt;/P&gt;&lt;P&gt;But sometimes, and apparently in a totally randomic behaviour, the attach_for_update method fails again and the CATCH structure calls attach_for_write method. And this will end in a Short Dump, saying "SHM Change Lock active".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have anyone an idea?&lt;/P&gt;&lt;P&gt;How should the area generation be made to have all this stuff work out correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 00:03:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518286#M569867</guid>
      <dc:creator>former_member199581</dc:creator>
      <dc:date>2007-07-18T00:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Shared Objects issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518287#M569868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about the free area method, are you using the detach_commit method after the update?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 00:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518287#M569868</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-18T00:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shared Objects issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518288#M569869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;yes, after the update, if no exception is triggered, I detach from the area using detach_commit (if an error occurs, i rollback changes using detach_rollback).&lt;/P&gt;&lt;P&gt;As a consequence of a detach, I must re-attach using attach_for_update everey time I need to made changes to the content of the area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tnx,&lt;/P&gt;&lt;P&gt;R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 08:02:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shared-objects-issue/m-p/2518288#M569869</guid>
      <dc:creator>former_member199581</dc:creator>
      <dc:date>2007-07-18T08:02:16Z</dc:date>
    </item>
  </channel>
</rss>

