Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:57:42+00:00 2026-06-14T07:57:42+00:00

Why would a process running a transaction at RC isolation level hold an IX

  • 0

Why would a process running a transaction at RC isolation level hold an IX page lock if it is already running a select statement on another table? I mean, i thought that locks are released when the statement finishes (that is why we could have non-repeatable reads).

Here’s the deadlock xml:

<deadlock-list>
 <deadlock victim="process5cd048">
  <process-list>
   <process id="process5cd048" taskpriority="0" logused="10000" waittime="2220" schedulerid="3" kpid="5764" status="suspended" spid="62" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-11-09T12:16:52.730" lastbatchcompleted="2012-11-09T12:16:52.730" lastattention="2012-11-08T17:33:28.597" clientapp=".Net SqlClient Data Provider" hostname="CWCEINAW" hostpid="4908" loginname="cwcuser" isolationlevel="read committed (2)" xactid="1157173773" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
     <frame procname="adhoc" line="1" sqlhandle="0x020000005b3f1719cc3b4ad87e96487fe7fbf624ab5c2984">
SELECT * FROM WP_CashCenter_StockTransactionLine
                    WHERE [StockTransaction_id] IN (
                        SELECT DISTINCT [ST].[id]
                        FROM WP_CashCenter_StockTransaction AS [ST]
                            LEFT JOIN WP_CashCenter_StockTransactionLine AS [STL] ON ([STL].[StockTransaction_id] = [ST].[id])
                        WHERE [ST].[Type] IN (1, 0, 10, 9)
AND ([STL].[Direction] IN (1, 0) OR [STL].[id] IS NULL) 
AND [ST].[Status] IN (0, 1)
AND ([STL].[StockContainer_id] = 3000080311 OR [ST].[StockContainerID] = 3000080311))     </frame>
    </executionStack>
    <inputbuf>
SELECT * FROM WP_CashCenter_StockTransactionLine
                    WHERE [StockTransaction_id] IN (
                        SELECT DISTINCT [ST].[id]
                        FROM WP_CashCenter_StockTransaction AS [ST]
                            LEFT JOIN WP_CashCenter_StockTransactionLine AS [STL] ON ([STL].[StockTransaction_id] = [ST].[id])
                        WHERE [ST].[Type] IN (1, 0, 10, 9)
AND ([STL].[Direction] IN (1, 0) OR [STL].[id] IS NULL) 
AND [ST].[Status] IN (0, 1)
AND ([STL].[StockContainer_id] = 3000080311 OR [ST].[StockContainerID] = 3000080311))    </inputbuf>
   </process>
   <process id="process33ebc8" taskpriority="0" logused="10676" waitresource="PAGE: 5:1:1144344" waittime="2221" ownerId="1157173773" transactionname="user_transaction" lasttranstarted="2012-11-09T12:16:52.197" XDES="0x41518b140" lockMode="S" schedulerid="5" kpid="5272" status="suspended" spid="62" sbid="0" ecid="9" priority="0" trancount="0" lastbatchstarted="2012-11-09T12:16:52.730" lastbatchcompleted="2012-11-09T12:16:52.730" clientapp=".Net SqlClient Data Provider" hostname="CWCEINAW" hostpid="4908" isolationlevel="read committed (2)" xactid="1157173773" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
     <frame procname="adhoc" line="1" sqlhandle="0x020000005b3f1719cc3b4ad87e96487fe7fbf624ab5c2984">
SELECT * FROM WP_CashCenter_StockTransactionLine
                    WHERE [StockTransaction_id] IN (
                        SELECT DISTINCT [ST].[id]
                        FROM WP_CashCenter_StockTransaction AS [ST]
                            LEFT JOIN WP_CashCenter_StockTransactionLine AS [STL] ON ([STL].[StockTransaction_id] = [ST].[id])
                        WHERE [ST].[Type] IN (1, 0, 10, 9)
AND ([STL].[Direction] IN (1, 0) OR [STL].[id] IS NULL) 
AND [ST].[Status] IN (0, 1)
AND ([STL].[StockContainer_id] = 3000080311 OR [ST].[StockContainerID] = 3000080311))     </frame>
    </executionStack>
    <inputbuf>
    </inputbuf>
   </process>
   <process id="process4e13048" taskpriority="0" logused="11448" waitresource="PAGE: 5:1:1144209" waittime="2172" ownerId="1157175935" transactionname="user_transaction" lasttranstarted="2012-11-09T12:16:52.997" XDES="0x3458e63b0" lockMode="S" schedulerid="7" kpid="3912" status="suspended" spid="58" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-11-09T12:16:53.070" lastbatchcompleted="2012-11-09T12:16:53.067" clientapp=".Net SqlClient Data Provider" hostname="CWCEINAW" hostpid="4908" loginname="cwcuser" isolationlevel="read committed (2)" xactid="1157175935" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
     <frame procname="adhoc" line="1" stmtstart="160" sqlhandle="0x02000000193c8a3bb37a516f7a7155b01a67b7772459f53e">
SELECT [D].*
                        FROM WP_Discrepancy as [D]
                        WHERE [D].[Level] = @Level
                        AND [D].[Status] IN (@StatusInProgress, @StatusConfirmed)
                        AND [D].[StockContainerID] = @StockContainerID     </frame>
     <frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000">
unknown     </frame>
    </executionStack>
    <inputbuf>
(@Level int,@StatusInProgress int,@StatusConfirmed int,@StockContainerID bigint)SELECT [D].*
                        FROM WP_Discrepancy as [D]
                        WHERE [D].[Level] = @Level
                        AND [D].[Status] IN (@StatusInProgress, @StatusConfirmed)
                        AND [D].[StockContainerID] = @StockContainerID    </inputbuf>
   </process>
  </process-list>
  <resource-list>
   <exchangeEvent id="Pipe43a6da400" WaitType="e_waitPipeGetRow" nodeId="1">
    <owner-list>
     <owner id="process33ebc8"/>
    </owner-list>
    <waiter-list>
     <waiter id="process5cd048"/>
    </waiter-list>
   </exchangeEvent>
   <pagelock fileid="1" pageid="1144344" dbid="5" objectname="WebPortal.dbo.WP_CashCenter_StockTransactionLine" id="lock326ee4180" mode="IX" associatedObjectId="72057594149601280">
    <owner-list>
     <owner id="process4e13048" mode="IX"/>
    </owner-list>
    <waiter-list>
     <waiter id="process33ebc8" mode="S" requestType="wait"/>
    </waiter-list>
   </pagelock>
   <pagelock fileid="1" pageid="1144209" dbid="5" objectname="WebPortal.dbo.WP_Discrepancy" id="lock339da6b80" mode="SIX" associatedObjectId="72057594163625984">
    <owner-list>
     <owner id="process5cd048" mode="SIX"/>
    </owner-list>
    <waiter-list>
     <waiter id="process4e13048" mode="S" requestType="wait"/>
    </waiter-list>
   </pagelock>
  </resource-list>
 </deadlock>
</deadlock-list>

As you can see process process4e13048 holds an IX lock on some page of table WP_CashCenter_StockTransactionLine. The current statement trying to execute is a SELECT which cannot finish, because it wants a shared lock on page of WP_Discrepancy (which is obvious) conflicting with SIX lock held by process process5cd048.

Again, why would the latter process hold that SIX lock? According to execution stack the statement being executed is a SELECT to WP_CashCenter_StockTransactionLine table.

I would expect the locks acquired by previous statements within the same process to preserve if I was running a transaction with Serializable IL. But that’s not the case.

Can anybody explain me what did I get wrong about RC isolation level.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:57:43+00:00Added an answer on June 14, 2026 at 7:57 am

    I thought that locks are released when the statement finishes

    Not write locks (X, IX, S-IX etc). Write locks must obey two phase locking so they are released at the end of the transaction. Think what would the opposite mean: a DELETE releases the X lock on the row deleted before the transaction ends, later a concurrent transaction INSERTs a new row with the same key (it can, since there is no lock) and now the first transaction wants to roll back. What could it do, it cannot insert back the row it deleted because the key was taken in the meantime by the second transaction, so it cannot rollback.

    So a deadlock can occur when running SELECTs because the transaction running those selects had acquired write locks before running the SELECT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understand whether a process would interfere another process running on the
Imagine I have an existing process running under windows as a particular user. Would
We would like to check if a specified process is currently running via PHP.
I have a long running io process that I would like to be able
i would like to process an undefinitely long string in C++ by chunks of
I would like to process a frame element in my source xml file using
i would like to process infrared imaging in Matlab. Any kind of processing or
What would be the process for BlackBerry App World to submit new release of
I would like to be able to spawn a linux process that would only
An example of the process/output would be: File1: hello world File2: foo bar Resulting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.