Questions tagged [transaction-isolation]

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

256 questions
2
votes
1 answer

Update-Insert in MySQL with REPEATABLE READ Isolation level

I've one secenario where i've to perform update-insert in MYSQL (I've to use REPEATABLE-READ Isolation level) The Secenario is - there is a table - +----+--------+--------+--------+ | ID | NAME | AMOUNT | STATUS…
2
votes
1 answer

How to set a Ruby on Rails 4+ app's default db isolation level

I want to make my application serialize every transaction by default. I'd then relax isolation based on performance measurements and knowing what data particular actions/transactions use and change. I doubt serializable by default would get into the…
2
votes
1 answer

Does MySQL InnoDB create consistent snapshots for SELECT on multiple tables with UNION when isolation level is READ COMMITTED

Consider two tables like this: TABLE: current ------------------- | id | dept | value | |----|------|-------| | 4| A | 20 | | 5| B | 15 | | 6| A | 25 | ------------------- TABLE: history ------------------- | id | dept |…
2
votes
2 answers

SQL Server: Atomic Trigger

I have two quick questions. Are SqlServer Triggers atomic by default? How to achieve it if not? The environment is simple. I have two users (let's call them UserA and UserB) with two different connections to the database. Both connections are…
Rumpelstinsk
  • 3,107
  • 3
  • 30
  • 57
2
votes
3 answers

Understanding the NOLOCK hint

Let's say I have a table with 1,000,000 rows and running a SELECT * FROM TableName on this table takes around 10 seconds to return the data. Without a NOLOCK statement (putting to one side issues around dirty reads) would this query lock the table…
Remotec
  • 10,304
  • 25
  • 105
  • 147
2
votes
2 answers

In MS SQL Server, how I can unlock the reading lock during a transaction in case of ReadCommitted?

When I start a transaction in MS SQL Server 2008 and update a table record the SQL server locks other users from reading that record (in case of Isolation level = Read Committed) unless I commit the transaction. How I can allow other users from…
Saad
  • 374
  • 5
  • 19
2
votes
2 answers

temporary deny acces to sql server for certain users

I have database that is a datawarehouse environment that loads data with an ETL process. During the ETL process I wish to make the database unavailable for querying for certain roles. What would be a possible solution?
2
votes
2 answers

Does REPEATABLE_READ isolation prevent inserts for non-ranged queries?

Given the following SQL pseudo-code: ... open transaction ... SELECT * FROM users WHERE users.id = 5 ... some calculation here ... INSERT INTO users (id) VALUES (5) ... commit transaction ... Is REPEATABLE_READ isolation guaranteed to prevent…
Gili
  • 86,244
  • 97
  • 390
  • 689
2
votes
2 answers

postgresql trigger: disable auto commit and set isolation level

i'm writing a trigger on database INSTEAD OF INSERT ON a table, that made some operation, then insert data into different related tables. Now i need to disable autocommit and set a different isolation level inside trigger, how can i do?
giozh
  • 9,868
  • 30
  • 102
  • 183
2
votes
1 answer

Crystal Reports with SQL Server 2005: Setting Transaction Isolation Level

Is there a way to specify the transaction isolation level when Crystal Reports queries a SQL Server 2005 database without resorting to any of the following: Encapsulating the report's query in a stored procedure that executes SET TRANSACTION…
2
votes
2 answers

How to properly manage collections in SQL Server

Assume that houses have occupants and that no two occupants of any house can have the same height. Pick a random house Get a list of the current occupants of the house Decide which ones to keep, replace, evict, or add by examining the list Make…
user1857716
2
votes
1 answer

ejb3 isolated (autonomous) transaction inside session bean

I'm using XA (2-phase) transaction. I want to log to one log-table through Log class and Entity Manager. My method inside EJB Session bean looks like: private void logError(Throwable throwable) { LogEntity logEntity = new LogEntity(); // Set…
zmeda
  • 2,909
  • 9
  • 36
  • 56
2
votes
1 answer

Hibernate second level cache and RR transaction isolation

If two transactions (both at RR isolation level) ask for the same item which is 2nd-level cached, and then they modify and store this item. Now, for reading that item, they did not run any SQL because it's cached; so in this case, will they actually…
shrini1000
  • 7,038
  • 12
  • 59
  • 99
1
vote
1 answer

Question on mongodb transaction isolation

In the sample code below, what will happen if retrieved data in the transaction changes(caused by an outside/separated write operation) before it ends or is committed? does the transaction automatically abort? await session.withTransaction(async ()…
Paulo
  • 63
  • 6
1
vote
1 answer

What exactly is snapshot in mysql on consistent nonlocking reads?

Mysql Reference explains that phantom read cannot be produced because it utilize snapshot for consistent nonlocking read.(A consistent read means that InnoDB uses multi-versioning to present to a query a snapshot of the database at a point in…
cjlee
  • 378
  • 3
  • 10