<?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: Custom Table Lock in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149362#M1368239</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;Job2 won't run successfully as job1 is not yet completed and the table is locked..so u will get Foreign_lock exceptrion in job2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Sep 2009 07:16:33 GMT</pubDate>
    <dc:creator>former_member404244</dc:creator>
    <dc:date>2009-09-16T07:16:33Z</dc:date>
    <item>
      <title>Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149360#M1368237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a program i'm inserting set of records into a Z-table.  (5 fields - All primary keys)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use table lock on the z-table , insert the records and unlock the z-table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what if my program is scheduled in background with different variants (lets say 5 jobs),  each job will try to update the Z-table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In such case , lets say job1 locks the table and updating 100000 entries to the z-table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meanwhile job2 want to update 5 entries to the Z-table tries to lock the table...  in this case Job2 runs successfully or not??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether lock and unlock is necessary in this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any inputs.??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 07:01:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149360#M1368237</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2009-09-16T07:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149361#M1368238</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;During such cases you need to have check on Job Run. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose like when you run a particular job if it is failed you need to run the job again after some time. This we can do in programming using some standard function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said the job will definitely fail as the table is locked for updating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 07:06:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149361#M1368238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-16T07:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149362#M1368239</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;Job2 won't run successfully as job1 is not yet completed and the table is locked..so u will get Foreign_lock exceptrion in job2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 07:16:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149362#M1368239</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-09-16T07:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149363#M1368240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Job2 wont run successfully during the execution of the Job1 due to lock created by Job1.&lt;/P&gt;&lt;P&gt;You can do onething, give particular time to execute Job1 and give later particular time to execute Job2 and on and on......&lt;/P&gt;&lt;P&gt;This will solve ur problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 07:20:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149363#M1368240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-16T07:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149364#M1368241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens if completely ignore the Lock and Unlock of Z-table and go with only inserting entries into that table??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 07:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149364#M1368241</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2009-09-16T07:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149365#M1368242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any inputs???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 08:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149365#M1368242</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2009-09-16T08:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Table Lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149366#M1368243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lakshmiraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally, when updating a lot of entries in a table, we try to lock table line per line (in order not to block other transaction also updating this table...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you decide to lock the whole table, it is a bit dangerous to parallelize the update of the table, since the first job will successfully lock the table but will prevent the other jobs to lock it and then to update it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So  I recommand you to split updating of this table between your different jobs by the first keys of your table, let say, only the first field. For the 1st job you will have to update all entries with 1st key field in range 0000 to 1000, 2nd job 1000 to 3000, ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like that you can lock your table only on the first key field (via a lock object created in SE11) and all jobs should run correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing : if your program is the only program / transaction /... which updates your table, lock object is not necessary. Lock only serves to prevent database inconsistency after 2 programs have updated the same line in an incorrect order...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will be clearer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Samuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2009 09:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-table-lock/m-p/6149366#M1368243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-16T09:09:12Z</dc:date>
    </item>
  </channel>
</rss>

