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 3611626
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:53:55+00:00 2026-05-18T21:53:55+00:00

I have the following SP: CREATE PROCEDURE [dbo].[sp_LockReader] AS BEGIN SET NOCOUNT ON; begin

  • 0

I have the following SP:

CREATE PROCEDURE [dbo].[sp_LockReader]  
AS  
BEGIN  
SET NOCOUNT ON;  
begin try   
set transaction isolation level serializable  
begin tran  
select * from teste  
commit tran  
end try  
begin catch  
rollback tran  
set transaction isolation level READ COMMITTED  
end catch  
set transaction isolation level READ COMMITTED  
END  

The table “test” has many values, so “select * from teste” takes several seconds. I run the sp_LockReader at same time in two diferent query windows and the second one starts showing test table contents without the first one terminates.

  • Shouldn’t serializeble level forces the second query to wait?
  • How do i get the described behaviour?

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-05-18T21:53:56+00:00Added an answer on May 18, 2026 at 9:53 pm

    SERIALIZABLE at the most basic means “hold locks for longer”. When you SELECT, the held lock is a shared lock which allows other readers.

    If you want to block readers, use WITH (TABLOCKX) hint to take an exclusive lock where you don’t need SERIALIZABLE. Or XLOCK with SERIALIZABLE

    In other words:

    • SERIALIZABLE = Isolation Level = lock duration, concurrency
    • XLOCK = mode= sharing/exclusivity
    • TABLOCK = Granularity = what is locked

    • TABLOCKX = combined

    See this question/answer for more info

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

Sidebar

Related Questions

I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
I have the following function: CREATE FUNCTION fGetTransactionStatusLog ( @TransactionID int ) RETURNS varchar(8000)
I have the following code to create a UIPickerView: pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0f,
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have the following database table created thus: CREATE TABLE AUCTIONS ( ARTICLE_NO VARCHAR(20),
I have the following table schema; CREATE TABLE `db1`.`sms_queue` ( `Id` INTEGER UNSIGNED NOT
I have the following table and data in SQL Server 2005: create table LogEntries
So I have the following user defined type in my oracle database: CREATE OR
I have a link that I dynamically create which looks something like the following:
I have the following rails migration: create_table :articles do |t| t.integer :user_id, :allow_null =>

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.