sijms / go-ora

Pure go oracle client
MIT License
796 stars 177 forks source link

ORA-01013 Error occurs seemingly randomly running a queries in a loop #479

Closed chrisfw closed 10 months ago

chrisfw commented 10 months ago

Hello,

Thank you for your work on this project. I really appreciate the effort that has gone into building a driver that doesn't require the Oracle Client.

I am hoping you can help me as I am experiencing a problem retrieving transaction counts for a set of tables in a loop. I get an ORA-01013 randomly as I iterate over the tables one by one running the query below changing just the table name. If I rerun the same query against the same table singly using go-ora, it works fine. I couldn't find any query response timeout settings to configure in the connection properties map, so I am at a loss as to how to fix this issue. Any assistance you can provide would be greatly appreciated.

Regards, Chris Whelan

Error executing query: SELECT count(*) as transactioncount from FWABILL WHERE ora_rowscn > (SELECT min(TIMESTAMP_TO_SCN(trunc((sysdate)))) FROM FWABILL), error: ORA-01013: user requested cancel of current operation

sijms commented 10 months ago

increate timeout of the operation

urlOptions := map[string]string {
    "trace file": "trace.log",
    // set timeout of the operation by passing number of seconds default 120
    // -1 means infinite
    "timeout": "-1", 
}
databaseUrl := go_ora.BuildUrl(server, port, service, user, password, urlOptions)
db, err := sql.Open("oracle", databaseUrl)
chrisfw commented 10 months ago

Thank you Samy for your quick response. I will try that setting.

Regards, Chris

On Fri, Dec 8, 2023 at 4:41 PM Samy Sultan @.***> wrote:

increate timeout of the operation

urlOptions := map[string]string { "trace file": "trace.log", // set timeout of the operation by passing number of seconds default 120 // -1 means infinite "timeout": "-1", }databaseUrl := go_ora.BuildUrl(server, port, service, user, password, urlOptions)db, err := sql.Open("oracle", databaseUrl)

— Reply to this email directly, view it on GitHub https://github.com/sijms/go-ora/issues/479#issuecomment-1847876743, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOZ7PPPSUSUBFMVHCRSL53YIOCQNAVCNFSM6AAAAABAM2Y2T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXHA3TMNZUGM . You are receiving this because you authored the thread.Message ID: @.***>

chrisfw commented 10 months ago

Hi @sijms , I updated my program to use the timeout option and it now works without issue. Thank you very much for your assistance in resolving this error.

Regards, Chris