Oracle Clientid

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
sukesh
Posts: 3
Joined: Tue 01 Feb 2011 05:27

Oracle Clientid

Post by sukesh » Tue 01 Feb 2011 05:57

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

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

Post by Shalex » Tue 01 Feb 2011 16:35

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.

sukesh
Posts: 3
Joined: Tue 01 Feb 2011 05:27

Post by sukesh » Mon 07 Feb 2011 10:49

Any updates from your investigation?

Thanks and Regards,
Sukesh.

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

Post by Shalex » Tue 08 Feb 2011 14:55

Our investigation is in progress. I will post here the results as soon as possible.

sukesh
Posts: 3
Joined: Tue 01 Feb 2011 05:27

Post by sukesh » Mon 21 Feb 2011 17:48

Any updates from your investigation?

Regards,
Sukesh

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

Post by Shalex » Tue 22 Feb 2011 11:04

We are investigating the issue. I will notify you about the results as soon as possible.

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

Post by Shalex » Tue 01 Mar 2011 11:09

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.

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

Post by Shalex » Mon 14 Mar 2011 09:48

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 .

gustavp
Posts: 10
Joined: Wed 13 Jul 2011 08:44

Client id

Post by gustavp » Wed 27 Jul 2011 07:49

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:

...




...

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

Post by Shalex » Fri 29 Jul 2011 12:05

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.

gustavp
Posts: 10
Joined: Wed 13 Jul 2011 08:44

Post by gustavp » Fri 29 Jul 2011 13:21

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.
Last edited by gustavp on Thu 18 Aug 2011 11:28, edited 1 time in total.

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

Post by Shalex » Mon 01 Aug 2011 06:43

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.

Post Reply