oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
408 stars 190 forks source link

Oracle.ManagedDataAccess.Core DbDataReader.ReadAsync does not handle cancellation properly #376

Closed nobodo closed 2 months ago

nobodo commented 2 months ago

When canceled, ReadAsync(cancellationToken) is sometimes giving ORA-12570.

As per Mircosoft documentation ReadAsync should throw OperationCanceledException. It seems that ODP.Net prefers to just throw OracleExceptions, which is fine, but in that case the error should be ORA-01013

Using version 23.4.0

alexkeh commented 2 months ago

For DbDataReader, the ReadAsync exception of DbException. For SqlClient, the relevant exception is the SqlException.

Both ORA-12570 and ORA-01013 are the Oracle DB errors that get returned to ODP.NET upon a ReadAsync cancel exception.

nobodo commented 2 months ago

Ok, I'll just close this then since it seems to be working as planned.