Questions tagged [transaction-isolation]

Transaction isolation relates to the visibility and impact of changes made in one transaction on concurrent transactions.

256 questions
0
votes
2 answers

How do I achieve a performant object isolation solution in concurrent transactions

I'm creating this method issueTransfer to achieve a transfer from one account to another. My solution is: public void issueTransfer(final int amount, final Account src, final Account dst) { /* * TODO implement issueTransfer using…
Nooblhu
  • 552
  • 15
  • 33
0
votes
1 answer

non-repeatable read vs. phantom read

I know that A non-repeatable read occurs, when during the course of a transaction, a row is retrieved twice and the values within the row differ between reads. and A phantom read occurs when, in the course of a transaction, two identical queries…
La Carbonell
  • 1,976
  • 5
  • 22
  • 52
0
votes
2 answers

IsolationLevel, Lock Modes, deadlocks and sp_getapplock in MS SQL Server

I am new to SQL server and the deadlocking like issues. I read articles about it. I want to understand following things: SQL server uses appropriate Lock Mode depending on the IsolationLevel I set while beginning the transaction. If this…
0
votes
2 answers

How do I use a transaction when reading data with Entity Framework 4?

I'm trying to utilize the SNAPSHOT transaction isolation level in Microsoft SQL Server 2008 R2 with the Entity Framework 4.0. However, this doesn't seem to be as easy as I first thought. To use SNAPSHOT isolation level, it has to be enabled in the…
0
votes
2 answers

Difference between snapshot, pessimistic, and optimistic transactions

I have been trying to understand these types of database transaction. From my understanding snapshot transaction maintain concurrency by sending a relatively small amount of time old snapshot of the database. Pessimistic blocks an operation of a…
0
votes
1 answer

how to avoid Dead lock due to multiple oledb command for same table in ssis

I am using multiple OLEDBCommand transformations(~10) to update same table based on different conditions. While loading data I am facing deadlock once in a while when two updates runs parallel. Is there anyway I can set Update statement to wait if…
Sam
  • 392
  • 1
  • 6
  • 18
0
votes
1 answer

How to implement the multiple NULL check transaction in mysql

I want to implement the NULL check logic in the MYSQL. Here is the code: mysql> create table temp ( id int, des varchar(100), primary key (id) ); mysql> SELECT @@tx_isolation; +-----------------+ | @@tx_isolation | +-----------------+ |…
zhfkt
  • 2,415
  • 3
  • 21
  • 24
0
votes
1 answer

Rails ActiveRecord connection session

I have the following piece of code in Rails 3.2 + mySQL application: ActiveRecord::Base.connection.execute("SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED") ActiveRecord::Base.transaction do @book =…
0
votes
1 answer

What kind of lock is placed on a row that's updated in a transaction?

If I start a transaction with isolation level "read uncommitted" in SQL Server, then I read and update a particular row, is that row then locked by virtue of being part of a transaction? If another transaction (also with read uncommitted) tries to…
Triynko
  • 18,766
  • 21
  • 107
  • 173
0
votes
1 answer

Locking when inserting in SQL Server Express 2014

I have a table with a column named Time of type datetime2. I need to run this entire query without anyone else reading or altering data in the table while its executing. IF NOT EXISTS (SELECT Id FROM Bookings WHERE Time >= '2016-02-02 09:00:00' AND…
Masterchief
  • 107
  • 3
  • 8
0
votes
1 answer

Conditionally locking method of a stateless EJB

A method of a stateless EJB have to do a read-and-insert operation in transaction. First step is a complex check to test if the insert operation is allowed with the given parameters. public boolean DoCheckThanCreateAndAddItemToGroup(Item newItem,…
0
votes
1 answer

PostgreSQL generic handler for serialization failure

This is a followup question from this one so I know I can use (blocking) LOCKs but I want to use predicate locks and serializable transaction isolation. What I'd like to have is a generic handler of serialization failures that would retry the…
Filipe Pina
  • 2,201
  • 23
  • 35
0
votes
1 answer

Consistently update multiple rows in a table, isolating from concurrent interference

I've got the task to synchronize two tables living in differents databases. So for every insert, update and delete that happens in the source table, these changes have to be replicated in the destination table. The destination table will be a clone…
Marcos
  • 1,237
  • 1
  • 15
  • 31
0
votes
1 answer

Sql inner query select between two transaction

Need help in understanding inner query select reads between two transaction UPDATE SER_NUMBERS SET SER_NUM = SER_NUM + 1 WHERE YEAR = (SELECT YEAR FROM (SELECT YEAR FROM SER_NUMBERS WHERE YEAR >= 1950 AND SER_NUM < 999 ORDER BY YEAR) WHERE ROWNUM…
0
votes
1 answer

Is REPEATABLE-READ too strict in postgresql?

Specifically, why their manual claims following a repeatable read transaction cannot modify or lock rows changed by other transactions after the repeatable read transaction began. Is that claim really necessary to guarantee absence of…
noonex
  • 1,975
  • 1
  • 16
  • 18