OCI invalid handle error

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

OCI invalid handle error

Post by DarrenColes » Fri 14 Jan 2011 10:27

We have recently decided to upgrade from an old version of your component to the latest release and are seeing some "OCI invalid handle" error messages that we were not previously getting. We are using oracle 10g and version 10.2 of the oracle client.

I have managed to reproduce the issue with the following piece of code:

Code: Select all

        private void button11_Click(object sender, EventArgs e)
        {
            OracleConnection oc = new OracleConnection();
            oc.ConnectionString = "pooling = false";
            oc.Unicode = true;
            oc.Direct = false;

            oc.Server = "development";
            oc.UserId = "system";
            oc.Password = "manager";
            oc.Open();

            OracleCommand o2 = new OracleCommand();
            o2.ParameterCheck = true;
            o2.Connection = oc;
            o2.CommandType = CommandType.Text;
            o2.CommandText = "SELECT dummy FROM dual";
            o2.Prepare();

            OracleCommand o3 = new OracleCommand();
            o3.ParameterCheck = true;
            o3.Connection = oc;
            o3.CommandType = CommandType.Text;
            o3.CommandText = "SELECT * FROM dual";
            o3.Prepare();

            o2.Dispose();
            o2 = null;

            //disconnect
            oc.Close();

            //reconnect
            oc.Open();

            //update query
            o3.CommandText = "SELECT dummy FROM dual where rownum=1";
            o3.Prepare();

        }
The problem sesms to go away if o2 is disposed before o3 is created, but in our application the sequence of events is much more compllicated and it would not be easy for us to make changes to work around this issue.

I hope you can help.

Thanks

Darren

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Tue 18 Jan 2011 09:28

please could someone respond to this issue.

Thanks

Darren

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

Post by Shalex » Tue 18 Jan 2011 12:56

Thank you for your report. We have reproduced the error (behaviour with the 11.2 version of Oracle Client is the same). We will investigate the issue and notify you about the results as soon as possible.

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

Post by Shalex » Wed 19 Jan 2011 10:07

We have fixed the problem with the OCI_INVALID_HANDLE error when a command is reused after connection is reopened. Look forward to the next build of dotConnect for Oracle. I will post here when it is avaiable for download.

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Wed 19 Jan 2011 17:14

thanks for your prompt response.

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

Post by Shalex » Thu 27 Jan 2011 16:25

New version of dotConnect for Oracle 6.10 is released!
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=20115 .

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Fri 28 Jan 2011 09:45

thanks, this fix is working nicely for our application.

Post Reply