<?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: catch lock situations accessing database tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149269#M1193302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, right now, i'm trying to put the data to update the table into the shared memory first, collecting them via a separate report every two hours or so and putting them into the table. Now only one report is writing to that table and i will not have this deadlock situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2009 17:08:38 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2009-02-03T17:08:38Z</dc:date>
    <item>
      <title>catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149262#M1193295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are lock situations (two or more reports are trying to modify the same row) catchable by cx_sy_sql_error? Or by any other technique?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 19:00:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149262#M1193295</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-02-02T19:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149263#M1193296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you talking about physical database locks or SAP locks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 19:07:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149263#M1193296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-02T19:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149264#M1193297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the case of concurrent updates on a database table i do not want a program failure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 02:56:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149264#M1193297</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-02-03T02:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149265#M1193298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rainer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well in case of concurrent updates of same table by different programs, you need to use lock objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goto SE11 &amp;amp; create a lock object if its not already available.&lt;/P&gt;&lt;P&gt;2 Funciton modules would be created ENQUEUE_* &amp;amp; DEQUEUE_*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use it in both the programs. ENQUEUE_* is used to lock the record &amp;amp; DEQUEUE is to unlock the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ENQUEUE_MARA' 
ExPORTING
MATNR = itab-matnr
...

EXCEPTIONS
...
..
IF sy-subrc &amp;lt;&amp;gt; 0.
message 'Record cannot be locked !' type 'E'.
else.
UPDATE/INSERT TABLE ....


CALL FUNCTION 'DEQUEUE_MARA'
...............


endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls. ensure that you pass the primary keys to the FM so that locking is done at record level &amp;amp; not at table level !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 03:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149265#M1193298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T03:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149266#M1193299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; In the case of concurrent updates on a database table i do not want a program failure.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are talking about SAP locks, then just don't test, but I'm not sure if you can get around physical database locks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 14:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149266#M1193299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T14:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149267#M1193300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to avoid that an update on a table abends the report due to a deadlock situatiuon. If the update can not be done is not critical.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:43:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149267#M1193300</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-02-03T15:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149268#M1193301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, according to this, it looks like it might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1221154"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might try asking this on one of the database forums. (But close this one first.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149268#M1193301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T15:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: catch lock situations accessing database tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149269#M1193302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, right now, i'm trying to put the data to update the table into the shared memory first, collecting them via a separate report every two hours or so and putting them into the table. Now only one report is writing to that table and i will not have this deadlock situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 17:08:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-lock-situations-accessing-database-tables/m-p/5149269#M1193302</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-02-03T17:08:38Z</dc:date>
    </item>
  </channel>
</rss>

