NetCore. OracleCommand. How to abort execution? — oracle-tech

    Forum Stats

  • 3,716,133 Users
  • 2,242,960 Discussions
  • 7,845,840 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

NetCore. OracleCommand. How to abort execution?

dotnetuser
dotnetuser Member Posts: 6
edited December 2019 in ODP.NET

Hello.

I'm using oracle.manageddataaccess.core.

I can’t specify the timeout or at least interrupt the execution of the command.
The only thing that works for sure

                var m_oracleConnectionImpl = __Get(connection, "m_oracleConnectionImpl");

                var m_marshallingEngine = __Get(m_oracleConnectionImpl,"m_marshallingEngine");

                var m_oracleCommunication = __Get(m_marshallingEngine,"m_oracleCommunication");

                var m_sessionCtx = __Get(m_oracleCommunication, "m_sessionCtx");

                var m_transportAdapter = __Get(m_sessionCtx, "m_transportAdapter");

                var m_client = (TcpClient)__Get(m_transportAdapter, "m_client");

                m_client.Close();

CommandTimeout + oob does not affect anything.

Is there another beautiful solution?

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited December 2019

    You can also try OracleCommand.Cancel.

    If the cancellation request is received after the results have been fetched in the case of a query or the command has already executed, no cancellation will occur as there is nothing left to cancel.

    If that is not the case and the command is not cancelling, turn on the server side network trace whether the cancel request is being received.

  • dotnetuser
    dotnetuser Member Posts: 6
    edited December 2019

    1. OracleCommand.Cancel. -

    This method does nothing. It cancels execution only in the first steps.

    2.
    OracleConnection.Dispose or Tansaction.Dispose - These methods are blocked, waiting for the completion of the command.

    3.
    Manual call of the break method through reflection does not bring the desired result.

  • dotnetuser
    dotnetuser Member Posts: 6
    edited December 2019

    The response from the server is that the command is aborted, but then a loop continues.
    pastedImage_0.png
  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited December 2019

    The ORA-01013 is what is expected when a command has been successfully canceled.

  • dotnetuser
    dotnetuser Member Posts: 6
    edited December 2019

    This is like a bug on the client side.

    internal class TTCError

            internal int ReadErrorMessage()

    NullReferenceException

    this.m_bindErrors[j].m_rowOffset = (int)this.m_marshallingEngine.UnmarshalUB4(false);

    this.m_bindErrors is null

    Missed array initialization.
    Oracle.ManagedDataAccess, Version=2.0.19.1

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited December 2019

    How does this bug exhibit itself in product behavior? Is the behavior in conflict with what is documented? An error is generally expected in a command cancellation situation. See more details in the Remarks section of the Cancel method.

    https://docs.oracle.com/en/database/oracle/oracle-data-access-components/19.3/odpnt/CommandCancel.html#GUID-AA7F3329-735…

  • dotnetuser
    dotnetuser Member Posts: 6
    edited December 2019
    The result of the bug is that the library cannot correctly process the response from the server, 
    due to the lack of array initialization, an exception is thrown,
    which leads to the resending of the command cancellation,
    then the response from the server,
    again the exception,
    the cancellation request again.

    In the previous message I took a screenshot of traffic from wireshark.
    The class, method, and place of exception are also indicated in the previous message.

    Under the debugger, I initialized the array manually,
    this led to the correct processing of the response from the server.
    The command execution call was interrupted and control was returned with the exception being thrown
    into the user code with the text that the command was interrupted.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited December 2019

    I filed bug 30708476 to track this issue. We'll have an engineer review the issue.

Sign In or Register to comment.