Stack Exchange Network

Stack Exchange network consists of 174 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

The tag has no usage guidance.

0
votes
1answer
62 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 ...
0
votes
0answers
20 views

how can snapshot isolation automatically prevent lost updates?

I'm reading the book Designing Data-Intensive Applications and there's a part of it that I don't really understand (below). The concept of "lost updates" that it's referring to is when two ...
0
votes
0answers
11 views

preventing some resource described in a database from being acquired more than once

I'm assuming SQL databases for this question. It's based on the diagram at the bottom from the Designing Data-Intensive Applications book. The diagram describes a dirty write scenario that cannot ...
5
votes
1answer
282 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
66 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
52 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
24 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
76 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
304 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
35 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 ...
-3
votes
1answer
119 views

Read Committed Snapshot Isolation Remove All Writer/Read Contention [duplicate]

Does Read Committed Snapshot Isolation remove read-write contention in any condition? This is what I am reading online. However, if a read query executes and acquires a shared lock first, it can block ...
0
votes
2answers
307 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
2k 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
494 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 ...
6
votes
1answer
998 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
241 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
71 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
120 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
332 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
426 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
190 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
444 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
426 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
33 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
77 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
475 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
897 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
479 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
41 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
63 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
443 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
73 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
724 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
135 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
115 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
386 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
2k 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
448 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
307 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 ...
3
votes
1answer
92 views

Concurrent reads and updates

Let's say I have a table with 50,000 transactions that need to be processed in the background in the same order they were received. I have a Windows service that polls for transactions, picks them up, ...
1
vote
0answers
261 views

NOLOCK vs Read Uncommitted

in our environment, reports are running on the subscriber and resulting in deadlocks with MS Replication SPs, which are doing inserts/updates. What's the best way to eliminate the deadlocks? We have ...
3
votes
1answer
552 views

MySQL MVCC implementation

The question is about the behavior of simultaneous SELECT and UPDATE in MySQL InnoDB table: We have a relatively large table which we periodically scan reading several fields including a field named, ...
0
votes
1answer
115 views

Forcing uncommitted read access via view?

I have an application (which I'm only the user of, i.e. I cannot change it, but I do have control over the database) that performs relatively simple, but potentially very frequent concurrent look-ups ...
2
votes
1answer
1k views

Read Committed Snapshot Isolation vs Read Committed - pros and cons?

We have an application from JD Edwards, for which the database runs on SQL Server 2005 or 2008R2. They have a new application vendor and he suggested to change isolation level to Read Committed ...
8
votes
1answer
326 views

Why would MySQL request a shared-lock after setting transaction level to READ UNCOMMITTED

Running a processing job in multiple parallel batches which basically reads big chunks of rows to update a few - it's OK here to use a lower transaction level since I know the relevant values won't be ...
2
votes
2answers
944 views

Blocking continues after enabling snapshot isolation

On database hosted on a SQL Server 2012 instance, I have enabled ALLOW_SNAPSHOT_ISOLATION and verified the state as ON using SELECT snapshot_isolation_state_desc,name from sys.databases However, in ...