Page 1 of 1

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

Posted: Fri 10 Sep 2010 22:17
by DarenM
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?

Posted: Mon 13 Sep 2010 12:38
by AndreyR
Thank you for the report, we are investigating the issue.
I will post here about the results of our investigation.

Posted: Fri 24 Sep 2010 18:17
by DarenM
Any updates?

Posted: Mon 27 Sep 2010 16:00
by AndreyR
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?