Page 1 of 1

Isolation Level Serializable ignored

Posted: Mon 09 Nov 2020 14:01
by Phil7
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

Re: Isolation Level Serializable ignored

Posted: Thu 12 Nov 2020 18:52
by Shalex
Thank you for your report. We will investigate the issue and notify you about the result.