<?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: locks issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318120#M1393960</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;U can create a lock object for your Z-TABLE by SE11, the name convention for the lock should be E&amp;lt;table name&amp;gt;: while activing it, the system generates 2 function module to lock and unlock, the function module will be called:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- ENQUEUE_&amp;lt;lock object&amp;gt; to set the lock&lt;/P&gt;&lt;P&gt;- DEQUEUE_&amp;lt;lock object&amp;gt; to delete the lock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both your programs: web service and job u should call the fm to set the lock ENQUEUE_&amp;lt;lock object&amp;gt;, if this fm returns sy-subrc equal to 0, it means the lock is set else the lock is just set, in this last case u should decide what u need to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case: A) Web service starts and it gets a lock active: I suppose u should stop the service because it means the job is running;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case B) Job start and it gets a lock active: it means a web service is running, so probably u need to stop the job (?), &lt;/P&gt;&lt;P&gt;u could have a conflict situation  if job is a priority higher than web service&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can use the fm DEQUEUE_&amp;lt;lock object&amp;gt; to delete the job, but u need to consider the lock is automatically deleted at the end of a task, so as soon as the job iand web service is finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2009 16:03:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-02T16:03:03Z</dc:date>
    <item>
      <title>locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318112#M1393952</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;I have table that called by service  (this process can take time since the table is full with data ) ,&lt;/P&gt;&lt;P&gt;the problem is that the table can be updated during the service read call which can cause inconsistency ,i read on the help about the read lock and exclusive lock i i think that i should use both of them but i am not sure ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i need to use both, how should i use it  ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; before the select i use the read lock or before the update ?&lt;/P&gt;&lt;P&gt;or for the update process i should use both of the locks ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any simple example will help .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;JOy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 07:29:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318112#M1393952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T07:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318113#M1393953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 09:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318113#M1393953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T09:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318114#M1393954</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;any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 12:29:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318114#M1393954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T12:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318115#M1393955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically you don't want anyone to modify the data when your service is reading it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Putting a lock on data from service before reading it will prevernt any changes being made during the read process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In update program you will have to make change (if it is not there already) so that it first request for lock and if request is successful then carry on changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 12:44:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318115#M1393955</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-11-02T12:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318116#M1393956</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;&lt;/P&gt;&lt;P&gt;basically what i need to use is Exclusive lock for update, multiple locks for the read process&lt;/P&gt;&lt;P&gt;but i need some simple example how i should use this both locks for the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Joy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Joy Stpr on Nov 2, 2009 2:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 13:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318116#M1393956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T13:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318117#M1393957</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;Have a look at this links&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1716213"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 13:05:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318117#M1393957</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-11-02T13:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318118#M1393958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think u're speaking about SAP lock, this is a logical lock and not a database lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's not really important if the lock is Exclusive or Read, because u need to check the lock and then decide what to do if the lock is active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After creating the lock by SE11, the system generates the fms in order to lock and unlock the lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem is u should place the control of the lock in the service and in all report can update your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every report should abort the running if the lock is actve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do u really want to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 13:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318118#M1393958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T13:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318119#M1393959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to do this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is scheduled job which update the table and can run for 1 hour (and can have 1000000 records ).&lt;/P&gt;&lt;P&gt;the web service is call to the table data with paging mechanism ( i.e. for 100 records in every service call ) the problem is if the service initiate a call and get 500 records and the update  process is started ,this can cause to inconsistency so for that i need the locks mechanism .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my opinion is to do Exclusive lock for update, multiple locks for read.&lt;/P&gt;&lt;P&gt;but i am not sure about it since i am new to this topic .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the update process do i need to lock all the table ?&lt;/P&gt;&lt;P&gt;since i  update the table via &lt;/P&gt;&lt;P&gt;MOdify Z table from itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for read i call every time for 100 or 200 records (select upto 100/200 users ) how should i lock it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 14:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318119#M1393959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T14:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318120#M1393960</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;U can create a lock object for your Z-TABLE by SE11, the name convention for the lock should be E&amp;lt;table name&amp;gt;: while activing it, the system generates 2 function module to lock and unlock, the function module will be called:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- ENQUEUE_&amp;lt;lock object&amp;gt; to set the lock&lt;/P&gt;&lt;P&gt;- DEQUEUE_&amp;lt;lock object&amp;gt; to delete the lock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both your programs: web service and job u should call the fm to set the lock ENQUEUE_&amp;lt;lock object&amp;gt;, if this fm returns sy-subrc equal to 0, it means the lock is set else the lock is just set, in this last case u should decide what u need to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case: A) Web service starts and it gets a lock active: I suppose u should stop the service because it means the job is running;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case B) Job start and it gets a lock active: it means a web service is running, so probably u need to stop the job (?), &lt;/P&gt;&lt;P&gt;u could have a conflict situation  if job is a priority higher than web service&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can use the fm DEQUEUE_&amp;lt;lock object&amp;gt; to delete the job, but u need to consider the lock is automatically deleted at the end of a task, so as soon as the job iand web service is finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 16:03:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318120#M1393960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T16:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318121#M1393961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; there is scheduled job which update the table and can run for 1 hour (and can have 1000000 records ).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on number of records you are updating, I will not recommend to put lock for each record as it will possibly overflow the Lock table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 16:07:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318121#M1393961</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-11-02T16:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318122#M1393962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI MAx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the update process do i need to lock all the table ?&lt;/P&gt;&lt;P&gt;since i update the table via&lt;/P&gt;&lt;P&gt;MOdify Z table from itab&lt;/P&gt;&lt;P&gt;the other option is to lock every record and modify it ,&lt;/P&gt;&lt;P&gt;what is your opinion ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for read i call every time for 100 or 200 records (select upto 100/200 users ) how should i lock it for every recored ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;joy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Joy Stpr on Nov 3, 2009 8:38 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 16:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318122#M1393962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T16:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318123#M1393963</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 updation of a table you need to lock the record which you want to update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the primary keys combination you can lock  the record which you are updating.These key combinations should be passed as arguments to the lock function module .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Lakshman N on Nov 4, 2009 6:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2009 09:18:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318123#M1393963</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-11-03T09:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: locks issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318124#M1393964</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;U need to lock the whole table and not a single record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember it's only a logic lock, so u can avoid a SQL updating, but u can check the result returned by fm to set the lock and decide what u need to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2009 11:38:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/locks-issue/m-p/6318124#M1393964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-03T11:38:25Z</dc:date>
    </item>
  </channel>
</rss>

