Getting a reference to OracleConnection

Getting a reference to OracleConnection

Postby 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?
sonicraf
 
Posts: 4
Joined: Wed 30 Oct 2013 14:23

Re: Getting a reference to OracleConnection

Postby 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.
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle