oracle / dotnet-db-samples

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

Feature request: add support for ApplicationName in connection strings #216

Closed madelson closed 2 years ago

madelson commented 2 years ago

Most .NET providers allow you to specify a value for ApplicationName in your connection string.

It seems that Oracle supports this on the backend using dbms_application_info.set_client_info, but it is not supported directly on the .NET side.

It would be great to add this capability to bring the Oracle provider more up to parity with the providers for other databases!

alexkeh commented 2 years ago

This property is available off the OracleConnection class, but not the connection string.

OracleConnection.ClientInfo

alexkeh commented 2 years ago

@madelson Did you still need Client Info in the connection string because you can't use the OracleConnection property? If so, can you provide details why?

madelson commented 2 years ago

@alexkeh thanks that will be useful. It would still be nice if this were a connection string property for consistency with the other providers though. I'm working on a library that supports multiple DB backends and Oracle is the only one that is missing this feature.

alexkeh commented 2 years ago

ClientInfo is intended to be more flexible. It can be used to identify individual connections within a connection pool. Whenever a connection is returned to the pool, ClientInfo is reset to NULL to prevent a re-used connection from using an old ClientInfo value.

Since ClientInfo's value can change when used by the same pool, it can't be used as a connection pool attribute. In almost all cases, when a connection string attribute changes, the entire pool is reset.