Page 1 of 1

Oracle Clientid

Posted: Tue 01 Feb 2011 05:57
by sukesh
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

Posted: Tue 01 Feb 2011 16:35
by Shalex
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.

Posted: Mon 07 Feb 2011 10:49
by sukesh
Any updates from your investigation?

Thanks and Regards,
Sukesh.

Posted: Tue 08 Feb 2011 14:55
by Shalex
Our investigation is in progress. I will post here the results as soon as possible.

Posted: Mon 21 Feb 2011 17:48
by sukesh
Any updates from your investigation?

Regards,
Sukesh

Posted: Tue 22 Feb 2011 11:04
by Shalex
We are investigating the issue. I will notify you about the results as soon as possible.

Posted: Tue 01 Mar 2011 11:09
by Shalex
We have fixed the bug with the OracleConnection.ClientId property in the Direct mode. I will post here when the new build of dotConnect for Oracle is available for download.

Posted: Mon 14 Mar 2011 09:48
by Shalex
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 .

Client id

Posted: Wed 27 Jul 2011 07:49
by gustavp
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:

...




...

Posted: Fri 29 Jul 2011 12:05
by Shalex
gustavp wrote:how does this work with connection pooling?
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: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?
For example, you can assign HttpContext.User.Identity.Name to OracleConnection.ClientId in the handler of the Login.LoggedIn event.

Posted: Fri 29 Jul 2011 13:21
by gustavp
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 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: For example, you can assign HttpContext.User.Identity.Name to OracleConnection.ClientId in the handler of the Login.LoggedIn event.
I was looking for something like that.
Thanks I will test it as soon, and give feedback.

Edit:
Hm now I can't even get the quoting to work.

Posted: Mon 01 Aug 2011 06:43
by Shalex
gustavp wrote:Edit:
Hm now I can't even get the quoting to work.
Please clear the "Disable BBCode in this post" checkbox when editing your post.