Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [isolation-level]

The tag has no usage guidance.

0
votes
0answers
16 views

Understanding non repeatable read anomaly in databases

This paper discusses in detail ANSI isolation levels discussed in ANSI SQL standard on page 84. Paper introduces following shorthand for describing histories which contain reads, writes, commits and ...
2
votes
1answer
59 views

Does using a read committed isolation level and a NOLOCK query hint impact performance?

Can having both the SET TRANSACTION ISOLATION LEVEL READ COMMITTED and WITH (NOLOCK) on all tables in SP cause conflicts and downgrade performance on the SP? I just noticed some changes that a dev ...
0
votes
0answers
20 views

Understanding repeatable read isolation level

Wikipedia defines following terms: With a lock-based concurrency control DBMS implementation, serializability isolation level requires read and write locks (acquired on selected data) to be ...
1
vote
0answers
18 views

What does postgresql do when two transactions with different isolation levels run simultaneously?

According to this, postgresql supports different isolation levels per connection and even different ones in the same connection. Let's say one connection is using serializable and another is using ...
0
votes
1answer
16 views

Aws RDS cpu Spike to 100% because of running set isolation command and set

My application running with the AWS RDS as a backend. currently i am doing a performance test. While doing that i am seeing RDS cpu usage goes 100% after 20min. While seeing the performance insights ...
1
vote
2answers
68 views

Is it possible to override a ReadCommittedSnapshot isolation level with ReadCommitted isolation level for a particular transaction?

The default isolation level of my database is "read committed snapshot". Please see the below screenshot. I have the table "Tickets' with the following data in my database. Now in connection 1, I ...
-1
votes
1answer
33 views

How to Set the Transaction Isolation level in a Table Value Multi Function

How do I set the transaction isolation level within in a table value multi function? I know it can be done in a stored procedure. create function dbo.Test() RETURNS @TestTable Table (test varchar(...
4
votes
2answers
245 views

Serializable range deadlocks

Help required on an inherited deadlock problem! The code given below appears to have been written some time back, in an attempt to address contention issues around the assigning of new ID values on ...
1
vote
1answer
37 views

Locks and dirty writes for SQL dbs

Lets say I have two transactions, t1 and t2, that write to the same two rows, r1 and r2. I understand a kind of “dirty write” would be if t1 overwrites t2 on r1 last while t2 overwrites t1 on r2. Is ...
5
votes
1answer
77 views

RCSI and index maintenance

I have a database that is RCSI enabled and I've been rebuilding my indexes online (SQL 2014 Enterprise) for as long as I can remember. My understanding is that if we were to rebuild the indexes ...
0
votes
1answer
78 views

SQL Server Version Store Performance differences between RCS and ASI

I understand that Read Committed Snapshot (RCS) operates at statement level, and Allow Snapshot Isolation (ASI) operates at transaction level, and both store row versions in tempdb. I also understand ...
5
votes
1answer
322 views

Read Committed Snapshot, stale data reads?

I'm running SQL Azure and I have a following case. I have two transactions W (writer) and R (reader). Both are running with RCSI (.net application with TransactionScopes using LTM). The R transaction ...
0
votes
2answers
132 views

Setting isolation level at database level

We have a data warehouse that's being dropped and reproduced every night. We have lots of SSRS reports that use the warehouse. Sometimes an SSRS report goes wrong and will never execute, thus ...
1
vote
1answer
53 views

Isolation level issue

I need some help in choosing the correct isolation level on my transactions. My situation is as follows. I have a table with a unique constraint over two columns. For the sake of the argument, lets ...
1
vote
1answer
37 views

Missing rows (gaps) on range read from the end of the table

On a data processing pipeline, getting gaps in returned data. Process A - inserts sequentially into a table. Table has an auto-increment primary key id. Process B - selects max(id) [into X] and then ...
1
vote
2answers
95 views

Are duplicates in Read Commited standard behaviour?

This refers to this question: Duplicate records returned from table with no duplicates The "read commited" isolation level assumes that one transaction could read same record differently, but it does ...
6
votes
1answer
673 views

Is snapshot isolation good?

My situation: Table: User { Id, Name, Stone, Gold, Wood } I have "write" threads: miningThread (every minute) UPDATE User SET Stone = @calculatedValue WHERE Id=@id UPDATE User SET Wood = @...
1
vote
1answer
25 views

Can sub-selects change in one single query in a read committed transaction?

I am querying the same table multiple times in a single query in a transaction with isolation level set to READ COMMITTED (which is the default in PostgreSQL). Examples are: BEGIN; WITH first AS (...
0
votes
1answer
36 views

Does READ COMMITED commited blocks any rows?

I know that there are four diffrent types of isolation levels in databases. I've read many articles about that but still, I don't get the idea of Read Commited level. Does this level lock the rows ...
0
votes
2answers
490 views

the role of “ Intent lock ” in transaction and concurrency

According to the book Microsoft Sql server 2012, Chapter 13 (Transactions and concurrency): If an exclusive page lock is held in one page of a table, another process can not get even a shared ...
11
votes
6answers
3k views

Best situation to use READ UNCOMMITTED isolation level

As we all know, READ UNCOMMITTED is the lowest isolation level in which things like dirty reads and phantom reads may accrue. When is the best time to use this isolation level and for what reasons ...
4
votes
1answer
788 views

Setting READ_COMMITTED_SNAPSHOT to ON while ALLOW_SNAPSHOT_ISOLATION is OFF

I experimented with various configurations of SQL Server databases and ended up setting READ_COMMITTED_SNAPSHOT to ON while ALLOW_SNAPSHOT_ISOLATION is OFF. I noticed that when enabling this, many ...
8
votes
1answer
2k views

Finding the default isolation level in SQL Server 2017 and Azure SQL DB

I'm reading a book related to transaction and concurrency. In one paragraph it is mentioned that: In on-premises SQL Server instance the default isolation level is Read-Committed based on locking ...
1
vote
2answers
382 views

SQL Difference Optimistic Reading and Optimistic Writing

What is the difference between optimistic read and optimistic write? Or probably more so, can someone define these 4? (a) Optimistic Reading (b) Pessimistic Reading (c) Optimistic Writing (d) ...
-1
votes
1answer
73 views

SQL Snapshot Isolations Phantom Rows

Does Read Committed Snapshot Isolation prevent phantom row issue? Does Snapshot Isolation prevent phantom row issue? I am seeing different results in researching online: Akira Yamamoto states: ...
0
votes
0answers
189 views

What is the advantage of the REPEATABLE READ isolation level?

I was reading about REPEATABLE READ isolation level in databases. From what I could understand, it ensures that whatever I read in a transaction is going to remain the same until I commit the ...
1
vote
1answer
555 views

How to write validation trigger which works with all isolation levels

Background I need to write validation trigger for a table. Due to nature of validation I can not use builtin integrity checks. For purpose of this question let's say that validation counts number of ...
0
votes
1answer
37 views

Changes made by TransactionA not seen by TransactionB eventhough TransactionA commits them. How is that possible?

Is it possible for 2 non concurrent connections to see the same data for a record even as the 1st connection commits its changes? Here is an example of what I am seeing from the audit logs: ...
3
votes
1answer
485 views

SQL Server Snapshot Isolation Level: How to create an Update Conflict?

Does anyone have an example of how to create an "Update Conflict" using Transaction Level Snapshot (Not ReadCommmittedSnapshotIsolation)? Error message example: Snapshot isolation transaction ...
0
votes
1answer
244 views

Read Committed Snapshop Isolation Level - Effect of NOLOCK

As I understand it, with Read Committed Snapshot, readers don't block writers and writers don't block readers. The only blocking that can occur is writers blocking writers. By default our database is ...
2
votes
2answers
542 views

Snapshot Isolation vs Read Committed - OLTP and Reporting Databases

I just finished reading an excellent article on isolation levels here. Our company will soon start development on a rewrite and expansion of our current product. My desire is to have an OLTP database ...
8
votes
1answer
502 views

Duplicate records returned from table with no duplicates

I have a stored procedure that queries a busy queue table that is used to distribute work in our system. The table in question has a primary key on WorkID and no duplicates. A simplified version of ...
2
votes
1answer
50 views

What happens when the lock limit is reached?

My question is about the default isolation level: "read committed". As I understand, during a read committed transaction, when we update a record, the system puts a lock on that record, so other ...
0
votes
2answers
89 views

UPDATE-SELECT Consistency Issue In Read Committed

In Read Committed isolation level, I would expect the following to deadlock since UPDATE statement will mark the row dirty and SELECT should not be able to read the row before transaction is committed ...
0
votes
1answer
581 views

MySQL 5.7: Scope of SET TRANSACTION ISOLATION LEVEL for SELECT

The documentation states that without the GLOBAL or SESSION keyword, the isolation level will be valid for the next transaction and will be reverted to the session default after the transaction was ...
0
votes
0answers
1k views

A read operation on a large object failed while sending data to the client

A few days ago, in one of my servers, I had the following alert pop out: A read operation on a large object failed while sending data to the client. A common cause for this is if the application ...
9
votes
4answers
581 views

Do I add read committed after SET TRANSACTION ISOLATION LEVEL SERIALIZABLE?

Inside a stored procedure, I have the following : ( sql server 2008 ) SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRANSACTION getStuff BEGIN TRY /* some selects, updates, etc, etc. */ ...
0
votes
1answer
42 views

Help troubleshooting mysql deadlock

We have a query, which is trying to update a row, placing a user at the end of a queue. To do this, it needs to grab the MAX(initialPositon) and set this row's initialPosition to MAX(initialPosition)+...
3
votes
1answer
89 views

SERIALIZABLE transaction information leak via serial

I'm trying to implement a deterministic configuration for database sessions, and one problem seems to be with sequences. The following example demonstrates: CREATE TABLE foo (id serial, n integer); -...
0
votes
1answer
49 views

Why a transaction retrieve the same row more than one time?

I understand that nonrepeatable read problem occurs when a transaction t1 retrives a row, transaction t2 then updates that row and transaction t1 then retrieves the same row again. T1 retrieved the ...
7
votes
2answers
625 views

Switching to RCSI

The company I work for currently uses SQL Server databases (latest Enterprise version usually) for a product we develop. I would describe it as an OLTP database that is somewhat equally write and ...
1
vote
1answer
81 views

Turning on RCSI on on-prem CRM 2015

We have crm-2015 on-prem, inplace and running and causing lot of deadlocks when someone tries to update anything in batch and same time if multiple users are reading those activities. We are ...
1
vote
1answer
777 views

Dirty Read on SQL Server

The SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED is at different part of the "BEGIN". Is the below two query behave the same? Will the views, viewOne and viewTwo, inherit the dirty read? Or the ...
4
votes
0answers
156 views

transaction chaining, isolation levels and atomicity

I'd like to ensure that I understand correctly how the concepts of transaction chaining, transaction isolation level and atomicity relate to each other. Here's my understanding: transaction chaining ...
2
votes
1answer
69 views

I cannot grasp the definition of serializable

Everybody says that "Serializable" means that for any given set of concurrent transactions, there is a serial ordering of those transactions which produces the same result. They also give an ...
0
votes
2answers
130 views

Does using lower Isolation Level improve OLTP performance?

We have a SQL Server 2008 R2 instance which gets millions of rows of data per day from automatic devices such as CTI and AVR. On the same instance there are many heavy reports which analyze the data. ...
5
votes
1answer
448 views

Where is Read Committed insufficient?

Wikipedia says that Read Committed is prone to non-repeatable reads. However, I can simply cache the first read result in my transaction (make a snapshot) and release the DB lock to let other ...
1
vote
3answers
3k views

Why can MySQL handle multiple updates concurrently and PostgreSQL can't?

Let's imagine you have a table with this definition: CREATE TABLE public.positions ( id serial, latitude numeric(18,12), longitude numeric(18,12), updated_at timestamp without time zone ) ...
0
votes
1answer
511 views

How to run a query in PL/SQL with Serializable transaction isolation

I want to run this SQL in Oracle 11g: declare a number; begin select count(*) into a from item w where w.Item_num='MOH601' ; dbms_output.put_line(a); end ; How to run this query with ...
3
votes
1answer
375 views

Is an anomaly possible if a serializable transaction interfers with another isolation level?

Let's assume transaction A runs in SERIALIZABLE and transaction B runs in a more permissive isolation level, like READ UNCOMMITTED. Can Transaction A now suffer from any anomaly introduced by ...