OCI invalid handle error

OCI invalid handle error

Postby 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: 47
Joined: Mon 28 Aug 2006 11:07

Postby DarrenColes » Tue 18 Jan 2011 09:28

please could someone respond to this issue.

Thanks

Darren
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby 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
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44

Postby 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.
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44

Postby DarrenColes » Wed 19 Jan 2011 17:14

thanks for your prompt response.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07

Postby 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 .
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44

Postby DarrenColes » Fri 28 Jan 2011 09:45

thanks, this fix is working nicely for our application.
DarrenColes
 
Posts: 47
Joined: Mon 28 Aug 2006 11:07


Return to dotConnect for Oracle