Page 1 of 1

OCI invalid handle error

Posted: Fri 14 Jan 2011 10:27
by DarrenColes
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

Posted: Tue 18 Jan 2011 09:28
by DarrenColes
please could someone respond to this issue.

Thanks

Darren

Posted: Tue 18 Jan 2011 12:56
by Shalex
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.

Posted: Wed 19 Jan 2011 10:07
by Shalex
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.

Posted: Wed 19 Jan 2011 17:14
by DarrenColes
thanks for your prompt response.

Posted: Thu 27 Jan 2011 16:25
by Shalex
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 .

Posted: Fri 28 Jan 2011 09:45
by DarrenColes
thanks, this fix is working nicely for our application.