<?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 Enqueue/Dequeue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-dequeue/m-p/8262341#M1632228</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;There are 2 reports accessing 1 table. I am facing the runtime error with description - "The database system detected a deadlock and avoided it by rolling back your transaction.u201D &lt;/P&gt;&lt;P&gt;Have come across implementing the ENQUEUE and DEQUEUE concept on the table. Please clarify the below queries:&lt;/P&gt;&lt;P&gt;1.Is the above error occuring beacuse the two reports are accessing the table at the same time?&lt;/P&gt;&lt;P&gt;2.Implementing EN/DEQUEUE will solve the problem?&lt;/P&gt;&lt;P&gt;3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajkamal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2011 02:33:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-11T02:33:34Z</dc:date>
    <item>
      <title>Enqueue/Dequeue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-dequeue/m-p/8262341#M1632228</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;There are 2 reports accessing 1 table. I am facing the runtime error with description - "The database system detected a deadlock and avoided it by rolling back your transaction.u201D &lt;/P&gt;&lt;P&gt;Have come across implementing the ENQUEUE and DEQUEUE concept on the table. Please clarify the below queries:&lt;/P&gt;&lt;P&gt;1.Is the above error occuring beacuse the two reports are accessing the table at the same time?&lt;/P&gt;&lt;P&gt;2.Implementing EN/DEQUEUE will solve the problem?&lt;/P&gt;&lt;P&gt;3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajkamal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 02:33:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-dequeue/m-p/8262341#M1632228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T02:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue/Dequeue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-dequeue/m-p/8262342#M1632229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should understand the difference between Database Locks &amp;amp; SAP locks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;The database system detected a deadlock and avoided it by rolling back your transaction&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;1.Is the above error occuring beacuse the two reports are accessing the table at the same time?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Initial look at the statement suggests that this is because of Database Lock collision. You need to check if both the programs were trying to &lt;EM&gt;write&lt;/EM&gt; (INSERT/UPDATE/MODIFY/DELETE) the same data to the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;2. Implementing EN/DEQUEUE will solve the problem?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It should. But make sure you don't lock the entire table, try to lock only the individual records which are being processed(This is a good coding practice, of course you can override it depending on your requirement).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No, afiak there is no such queue. Alternatively you can put the lock in a iteration(viz., DO loop, WHILE loop) &amp;amp; check when the locks are released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i'm clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 03:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-dequeue/m-p/8262342#M1632229</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-10-11T03:07:16Z</dc:date>
    </item>
  </channel>
</rss>

