Oracle Clientid
Oracle Clientid
Hi,
I know that this issue has been discussed earlier, but since I am getting this error I will raise it again. I am using dotconnect for Oracle version 6.0.58.0 and am writing the following code
Devart.Data.Oracle.OracleConnection conn = new OracleConnection("User Id=xxxx;Password=yyy;Server=10.x.x.y;Direct=True;Sid=Ora2009;Persist Security Info=True;");
conn.ClientId = "Sukesh";
Devart.Data.Oracle.OracleCommand command = new OracleCommand("SELECT SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER') FROM DUAL", conn);
conn.Open();
var result = command.ExecuteScalar();
conn.Close();
I always get null value in the result. Am I doing something obviously wrong here or is the provider having problems setting the client identifier.
Thanks & Regards,
Sukesh
I know that this issue has been discussed earlier, but since I am getting this error I will raise it again. I am using dotconnect for Oracle version 6.0.58.0 and am writing the following code
Devart.Data.Oracle.OracleConnection conn = new OracleConnection("User Id=xxxx;Password=yyy;Server=10.x.x.y;Direct=True;Sid=Ora2009;Persist Security Info=True;");
conn.ClientId = "Sukesh";
Devart.Data.Oracle.OracleCommand command = new OracleCommand("SELECT SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER') FROM DUAL", conn);
conn.Open();
var result = command.ExecuteScalar();
conn.Close();
I always get null value in the result. Am I doing something obviously wrong here or is the provider having problems setting the client identifier.
Thanks & Regards,
Sukesh
The OracleConnection.ClientId property works only in the OCI mode (via Oracle Client) at the moment. We will investigate the reason why it doesn't work in the Direct mode and notify you about the results.
In the OCI mode ClientId is initialized at the server side after the execution of the first (any) query at the connection. This is a designed behaviour.
In the OCI mode ClientId is initialized at the server side after the execution of the first (any) query at the connection. This is a designed behaviour.
New build of dotConnect for Oracle 6.10.121 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20472 .
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20472 .
Client id
How do I use the client ID?
I would like to somehow add the client ID to the connectionstring in web.config so I don't have to set the clientid every time I use a connection (and how does this work with connection pooling?)
I can insert ClientId into the connectionstring, but I need to be able to pass httpcontext.user.identity.name to the connectionstring. How do I go about that?
my connectionstring looks something like this:
web.config:
...
...
I would like to somehow add the client ID to the connectionstring in web.config so I don't have to set the clientid every time I use a connection (and how does this work with connection pooling?)
I can insert ClientId into the connectionstring, but I need to be able to pass httpcontext.user.identity.name to the connectionstring. How do I go about that?
my connectionstring looks something like this:
web.config:
...
...
All connections in the same pool have the same connection string. Could you please describe the problem you have encountered with the client ID and connection pooling?gustavp wrote:how does this work with connection pooling?
For example, you can assign HttpContext.User.Identity.Name to OracleConnection.ClientId in the handler of the Login.LoggedIn event.gustavp wrote:I can insert ClientId into the connectionstring, but I need to be able to pass httpcontext.user.identity.name to the connectionstring. How do I go about that?
I don't have problems, I was just wondering how it works across the pool, if different users draw connections from the same pool.Shalex wrote: All connections in the same pool have the same connection string. Could you please describe the problem you have encountered with the client ID and connection pooling?
I was looking for something like that.Shalex wrote: For example, you can assign HttpContext.User.Identity.Name to OracleConnection.ClientId in the handler of the Login.LoggedIn event.
Thanks I will test it as soon, and give feedback.
Edit:
Hm now I can't even get the quoting to work.
Last edited by gustavp on Thu 18 Aug 2011 11:28, edited 1 time in total.