ORA-01453: SET TRANSACTION must be first statement...

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
DarenM
Posts: 8
Joined: Fri 30 Jul 2010 01:05

ORA-01453: SET TRANSACTION must be first statement...

Post by DarenM » Fri 10 Sep 2010 22:17

I am repeatedly seeing this error in an area of my application and I am unable to diagnose why I am seeing it. Here is a snippet of what I see in the DB Mon log File:

Code: Select all

  9/10/2010 4:09:21 PM 0.032 Close connection Complete
  9/10/2010 4:09:21 PM 0.016 Connection is returned to pool. Pool has 2 connection(s). Complete
  9/10/2010 4:09:22 PM 0.141 Disconnect Complete
  9/10/2010 4:09:25 PM 0.015 Creating object Complete
  9/10/2010 4:09:25 PM 0.032 Open connection: "User Id=pqdev;Password=*******;Server=tst-db-ora1;Direct=True;Sid=cctest;Port=1528;Persist Security Info=True;" Complete
  9/10/2010 4:09:25 PM 0.016 Taking connection from connection pool: "User Id=pqdev;Password=*******;Server=tst-db-ora1;Direct=True;Sid=cctest;Port=1528;Persist Security Info=True;" Complete
  9/10/2010 4:09:25 PM 0.000 Connection is taken from pool. Pool has 1 connection(s). Complete
  9/10/2010 4:09:25 PM 0.015 Prepare: SET TRANSACTION ISOLATION LEVEL READ COMMITTED Complete
  9/10/2010 4:09:25 PM 0.421 Execute: SET TRANSACTION ISOLATION LEVEL READ COMMITTED Error
  9/10/2010 4:09:26 PM 0.016 Close connection Complete
  9/10/2010 4:09:26 PM 0.000 Connection is returned to pool. Pool has 1 connection(s). Complete
And the ORACLE error is: ORA-01453: SET TRANSACTION must be first statement of transaction

I cannot see why this is happening - any tips on what else I can do to diagnose what is going on?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 13 Sep 2010 12:38

Thank you for the report, we are investigating the issue.
I will post here about the results of our investigation.

DarenM
Posts: 8
Joined: Fri 30 Jul 2010 01:05

Post by DarenM » Fri 24 Sep 2010 18:17

Any updates?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 27 Sep 2010 16:00

I have made some tests with TransactionScope and connection pool but failed to reproduce the problem.
For example, the following code worked OK:

Code: Select all

      OracleMonitor mon = new OracleMonitor();
      mon.IsActive = true;
      mon.TraceEvent += new Devart.Common.MonitorEventHandler(mon_TraceEvent);
      for (int i = 0; i <= 5; i++)
        using (TransactionScope ts = new TransactionScope()) {
          using (Entities db = new Entities()) {
            Dept d = new Dept
            {
              Deptno = 90 + i,
              Dname = "pooling"
            };
            db.AddToDepts(d);
            db.SaveChanges();
          }
          ts.Complete();
        }
Max pool size was set to 2.
Could you please either make some modifications in the following code to reproduce the problem, or to send us a small test project illustrating the problem?

Post Reply