Did you check Enterprise Library's OracleDataBase implementation? Best Regards, Ido Samuelson Senior Consultant Magen - Microsoft Technology Center
-----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Eduard Lascu Sent: Wednesday, April 13, 2005 3:20 PM To: [email protected] Subject: Re: [ADVANCED-DOTNET] State of a database connection Ido, That property is implemented by the OracleConnection class too (which inherits IDbConnection interface). The problem is that the property is not internally updated. It will change from ConnectionState.Open to ConnectionState.Close and the other way around only when the user calls Open and Close on the connection object. I need something to tell me that the connection has gone down when I try to use it. If the connection was opened, the State will stay ConnectionState.Open until I call Close on the connection object. Meantime, the physical connection can be interrupted by some external conditions, and there is no way I can tell that. I hope I was clearer this time. Thanks, Eddie -----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of עידו שמואלסון Sent: Wednesday, April 13, 2005 5:15 AM To: [email protected] Subject: Re: [ADVANCED-DOTNET] State of a database connection In System.Data.IDbConnection check the State property. This return the System.Data.ConnectionState enum. Best Regards, Ido Samuelson Senior Consultant Magen - Microsoft Technology Center -----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Eduard Lascu Sent: Tuesday, April 12, 2005 9:58 PM To: [email protected] Subject: [ADVANCED-DOTNET] State of a database connection I recently ran into a problem trying to figure out what is the state of my Oracle database connection object (I refer to Oracle specific classes, but I assume it's the same throughout the entire Framework Class Library). When I get the OracleConnection.State property I obtain ConnectionState.Open even when the connection has actually gone down recently. Executing a command will raise an exception, but I need to check the state of the connection before I go to execute the command. I guess something like the old CDatabase::IsOpen would be great. Did anyone here have implemented an IsDatabaseOpen method that will check the state of the connection? I could issue a dummy SQL statement, such as "select sysdate from dual" or something inside the IsDatabaseOpen method, but I noticed that the error raised can have a different code whether you disable the local network, unplug the cable or just reboot the database server. I checked all the methods offered in the interface and there is little to use to create this functionality. Any idea would be great. TIA =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
