Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with FbConnect [DNET591] #193

Closed
firebird-automations opened this issue Feb 9, 2015 · 8 comments
Closed

Problem with FbConnect [DNET591] #193

firebird-automations opened this issue Feb 9, 2015 · 8 comments

Comments

@firebird-automations
Copy link

Submitted by: Serj Dolzhenko (feanorser)

Is related to DNET668

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.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Can you provide a test case?

@firebird-automations
Copy link
Author

Commented by: Peter Muzik (info_pharmasoft.hu)

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;
        \}
    \}

@firebird-automations
Copy link
Author

Commented by: @cincuranet

What do you mean by "if the connection is broken"?

@firebird-automations
Copy link
Author

Commented by: Serj Dolzhenko (feanorser)

I have nearly the same test case with Peter Muzik.
Connection is broken can mean what remote computer shutdown or network connection lost.

@firebird-automations
Copy link
Author

Commented by: Peter Muzik (info_pharmasoft.hu)

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

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue is related to DNET668 [ DNET668 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

That's exactly what DNET668 is shooting at.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants