Getting a reference to OracleConnection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
sonicraf
Posts: 4
Joined: Wed 30 Oct 2013 14:23

Getting a reference to OracleConnection

Post by sonicraf » Thu 17 Jul 2014 22:05

I am trying to set the ClientId connection attribute which was added to OracleConnection.

I've spent hours trying to figure out how to get a reference to OracleConnection to set this property but I can't find any documentation.

Since I am using Entity Framework, the connection is not instantiated in code. Just a section in web.config.

Code: Select all

  <Devart.Data.Oracle.Entity xmlns="http://devart.com/schemas/Devart.Data.Oracle.Entity/1.0">
    <CodeFirstOptions ColumnTypeCasingConventionCompatibility="true" />
  </Devart.Data.Oracle.Entity>
and then I just configure the DbContext

Code: Select all

public class Db : DbContext
protected override void OnModelCreating(DbModelBuilder modelBuilder){...}
and all the EF code is applied to an instance of Db() class.

Somehow I need to get an instance to OracleConnection, to set the ClientId property so that it is used in all of the queries. How can this be done?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Getting a reference to OracleConnection

Post by Shalex » Mon 21 Jul 2014 14:59

sonicraf wrote:set the ClientId property so that it is used in all of the queries. How can this be done?
Please set a client identifier via the ClientId connection string parameter.

Post Reply