Issue Details (XML | Word | Printable)

Key: DNET-591
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Serj Dolzhenko
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

Problem with FbConnect

Created: 09/Feb/15 10:05 AM   Updated: 31/Mar/17 11:56 AM
Component/s: ADO.NET Provider
Affects Version/s: 4.6.1.0
Fix Version/s: None

Environment: Windows 7/Windows 2008R2, C# 4.0
Issue Links:
Relate
 


 Description  « Hide
In my code i have one FbConnection for listening events from DB, it opens at programm starts and normaly closes only with program, but if there is no events for some reason for long interval of time i made close connection and try to open it again. Then i'm testing this version of .Net data provider i found that open connection didn't throw any exception and open connection to remote DB then there is no link to lan and DB at all. Previous version that i test (4.1.0.0) throws here exception - unable to complete network request.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura added a comment - 10/Apr/15 09:57 AM
Can you provide a test case?

Peter Muzik added a comment - 16/Apr/15 12:25 AM
I have found the same problem.
When connection is lost to remote database the Open() does not throw any exception!
The connection can not be opened, but the ConnectionState is set to Opened, and no exception is thrown.

        private FbConnection fdb=null;
.
.

 fdb = new FbConnection(ConnectionString); //O.K, not null
.
.
then call:
        private bool ConnectFb()
        {
            if (fdb.State == System.Data.ConnectionState.Open)
            {
                Program.mf.ToMsg("Already connected");
                return true;
            }
            

            try
            {
                Program.mf.ToMsg("Fb Connecting...");
                fdb.Open(); // version 4.1.0 throws exception here, 4.6.1 fails to give any proper response if connection is broken
                Program.mf.ToMsg("Fb Connected");

                return true;
            }
            catch (Exception exc)
            {
                Program.mf.ToMsg("ERROR, database is not available.");
                Program.mf.ToMsg(exc.Message);
                return false;
            }
        }

Jiri Cincura added a comment - 16/Apr/15 01:58 AM
What do you mean by "if the connection is broken"?

Serj Dolzhenko added a comment - 16/Apr/15 05:17 PM
I have nearly the same test case with Peter Muzik.
Connection is broken can mean what remote computer shutdown or network connection lost.

Peter Muzik added a comment - 21/May/15 07:02 PM
Exactly.
I use fdb.Open() and fdb.Close() before and after each query.
When remote computer shutdown or network connection lost, it is not thrown the exception in 4.6.1 but it is good in 4.1.0

Jiri Cincura added a comment - 31/Mar/17 11:56 AM
That's exactly what DNET-668 is shooting at.