How to troubleshoot ORA-02049 and lock problems in general with Oracle

前端 未结 5 1353
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 03:39

I am getting ORA-02049 occasionally for some long-running and/or intensive transactions. There is seemingly no pattern to this, but it happens on a simple INSERT.

I

5条回答
  •  臣服心动
    2020-12-31 04:16

    Ok, this was a silly problem.

    We are using Entity Framework 6.0 (upgraded to 6.2, but no change), Oracle.ManagedDataAccess +EntityFramework 12.2.1100, .NET 4.5.

    I was getting ORA-02049: timeout: distributed transaction waiting for lock with the following query:

    update "schemaname"."tablename"
    set "DUE_DATE" = :p0
    where ("ID" = :p1) 
    

    (via EF context.Database.Log event). A really simple query, shouldn't have any issues.

    Well, I was using the same login on the remote server, on my local debugger, and in Oracle SQL Developer. A co-worker pointed out I should kill all these multiple connections while debugging .... and it worked. So the solution in my case was not to connect to the database multiple times with the same login.

提交回复
热议问题