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

Error reading from connection : FirebirdSQL Connection Pooling (ADO.NET) is not Working [DNET667] #621

Closed
firebird-automations opened this issue Feb 2, 2016 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: alexedu (alexedu_2)

Duplicates DNET585

Attachments:
FirebirdConsoleClient.zip

The Connection Pooling should NOT USE broken connection

This issue did not happen when using the previous http://ADO.NET Provider v.4.5.2.0.

I attached small console app where you will be able to reproduce issue.

@firebird-automations
Copy link
Author

Commented by: alexedu (alexedu_2)

This piece of code will allow you to see that connection pool doesn't work correctly after for example server instance rebooting / dropping connection from outside or etc

using FirebirdSql.Data.FirebirdClient;
using System;
using System.Timers;

namespace ConsoleClient
{
class Program
{
private static System.Timers.Timer timer;

    static void Main\(string\[\] args\)
    \{
        timer = new System\.Timers\.Timer\(5000\);
        timer\.Elapsed \+= new ElapsedEventHandler\(OnTimedEvent\);
        timer\.Enabled = true;

        Console\.ReadLine\(\);
    \}

    private static void OnTimedEvent\(object sender, ElapsedEventArgs e\)
    \{
        timer\.Enabled = false;
        try
        \{
            using \(var connection = new FbConnection\("Server=test;User=test;Password=test;Database=test;Charset=utf8"\)\)
            \{
                connection\.Open\(\);
                using \(var command = new FbCommand\("select 1 from rdb$database", connection\)\)
                \{
                    var result = command\.ExecuteScalar\(\);
                \}
                connection\.Close\(\);
            \}
        \}
        catch \(Exception ex\)
        \{
            Console\.WriteLine\(ex\.Message\);
        \}
        finally
        \{
            timer\.Enabled = true;
        \}
    \}
\}

}

@firebird-automations
Copy link
Author

Modified by: alexedu (alexedu_2)

Version: 4.10.0.0 [ 10742 ]

Attachment: FirebirdConsoleClient.zip [ 12893 ]

description: Actual result:
Engine Code: 335544726
Engine Message: Error reading data from the connection.
See: ADONETConnectionPoolingERROR.png

Expected Result:
The Connection Pooling should be automatically restored when any disconnection occurs between requests;

Steps to reproduce the issue:
1- Open a FirebirdSQL Connection Pooling (http://ADO.NET) using the http://ADO.NET Provider v.4.6.0.0 (Reference: http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.100).aspx) and do a Data request: The data is received without any issue;
2- Interupt the FirebirdSQL Server (net stop FirebirdServerDefaultInstance) and restart it (net start FirebirdServerDefaultInstance);
3- Try to request any other data from the Database using the same FirebirdSQL Connection Pooling open before.

Additional Information:
This issue did not happen when using the previous http://ADO.NET Provider v.4.5.2.0.

=>

The Connection Pooling should NOT USE broken connection

This issue did not happen when using the previous http://ADO.NET Provider v.4.5.2.0.

I attached small console app where you will be able to reproduce issue.

environment: Firebird 2.5.3.26780 (x64);
Windows 10 Pro;

=>

Firebird 2.5.x

Version: 4.6.0.0 [ 10640 ] =>

@firebird-automations
Copy link
Author

Commented by: alexedu (alexedu_2)

I also will take a look to the FbConnectionPoolManager.
Because I almost sure that changes which broke connection pooling mechanism were made since 4.5.2 release in that file.

@firebird-automations
Copy link
Author

Commented by: alexedu (alexedu_2)

Information about SQL Server connecting pooling

If SQL Server stops all connections currently in pool will be broken. Connection pool doesn't validate the state of the connection. You will most probably get exception for each broken connection but next calls will create new connection and CRUD operations will work again.

As you can see SQL Server will create new connection and CRUD operations will work again.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue duplicates DNET585 [ DNET585 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

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

resolution: Duplicate [ 3 ]

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