Isolation Level Serializable ignored

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Phil7
Posts: 1
Joined: Mon 09 Nov 2020 12:41

Isolation Level Serializable ignored

Post by Phil7 » Mon 09 Nov 2020 14:01

Hi!
We are using devart / dotConnect (Version=9.6.675.0) with EF6 and Oracle 12c and noticed that setting the isolation level for a transaction to 'Serializable' seems to have no effect.

We know that we are not using latest version but we did not find any release notes concerning this topic either.
This post (2016) issues the same problem for MySql-DB as we have been facing for Oracle: viewtopic.php?t=33532

Here a test snipped to be run in 2 different instances / threads

Code: Select all

        public void Test(Entities dbContext, string value)
        {
            using (var connection = dbContext.Connection)
            {
                connection.Open();
                using (var transaction = connection.BeginTransaction(System.Data.IsolationLevel.Serializable)) 
                {
                    var street = dbContext.Street.First(row => row.Id == 12345);
                    street.Name = value;
		    // <-- Break and sync executions here before SaveChanges()
                    dbContext.SaveChanges();
                    transaction.Commit();
                }
            }
        }
Native SQL-equivalent (Oracle) would be

Code: Select all

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update street set name = 'Test' where id = 12345;
commit;
Executing dbContext.SaveChanges(); in first thread blocks dbContext.SaveChanges(); in second thread - as expected - until commit or rollback (same as for IsolationLevel.ReadCommitted).

But upon transaction.Commit(); of first transaction we expect an Oracle Exception in second thread - which is not happening.


Is this a bug or are we doing something wrong?
Thanks in advance!
Phil

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Isolation Level Serializable ignored

Post by Shalex » Thu 12 Nov 2020 18:52

Thank you for your report. We will investigate the issue and notify you about the result.

Post Reply