Page 1 of 1

Getting a reference to OracleConnection

Posted: Thu 17 Jul 2014 22:05
by sonicraf
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?

Re: Getting a reference to OracleConnection

Posted: Mon 21 Jul 2014 14:59
by Shalex
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.