dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.95k stars 4.65k forks source link

Request for Implementation of DbException.SqlState and DbException.IsTransient in System.Data.Odbc #96849

Open ashishoffline opened 8 months ago

ashishoffline commented 8 months ago

Enhance System.Data.Odbc's OdbcException by implementing the newly introduced properties, SqlState and IsTransient, in DbException. While the Error property of OdbcException currently allows accessing SqlState through OdbcError, directly exposing it through SqlState property in DbException would provide a more streamlined access to these properties.

https://github.com/dotnet/runtime/issues/34817 https://github.com/dotnet/runtime/issues/35601

@roji

ghost commented 8 months ago

Tagging subscribers to this area: @roji, @ajcvickers See info in area-owners.md if you want to be subscribed.

Issue Details
Enhance System.Data.Odbc's OdbcException by implementing the newly introduced properties, SqlState and IsTransient, in DbException. While the Error property of OdbcException currently allows accessing SqlState through OdbcError, directly exposing it through SqlState property in DbException would provide a more streamlined access to these properties. https://github.com/dotnet/runtime/issues/34817 https://github.com/dotnet/runtime/issues/35601 @roji
Author: ashishoffline
Assignees: -
Labels: `area-System.Data`, `untriaged`
Milestone: -
roji commented 8 months ago

Thanks, exposing OdbcException.OdbcError via DbException.SqlState indeed seems like a good idea.

However, I'm not sure I like the idea of us hardcoding specific SQLSTATE codes (or classes) as transient; in theory codes and classes are standardized enough, but the situation in practice may be quite different, and it's probably better to not take a position there.

ghost commented 8 months ago

Tagging subscribers to this area: @roji, @ajcvickers See info in area-owners.md if you want to be subscribed.

Issue Details
Enhance System.Data.Odbc's OdbcException by implementing the newly introduced properties, SqlState and IsTransient, in DbException. While the Error property of OdbcException currently allows accessing SqlState through OdbcError, directly exposing it through SqlState property in DbException would provide a more streamlined access to these properties. https://github.com/dotnet/runtime/issues/34817 https://github.com/dotnet/runtime/issues/35601 @roji
Author: ashishoffline
Assignees: -
Labels: `enhancement`, `area-System.Data.Odbc`
Milestone: -