Unhandled exception at 
FirebirdSql.Data.Client.Managed.FirebirdNetworkStream.Flush()
------------------------------------------------------------------------------------

                 Key: DNET-1014
                 URL: http://tracker.firebirdsql.org/browse/DNET-1014
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 7.10.1.0
         Environment: Windows 10 version 20H2
.NET Framework 4.8
            Reporter: Luciano Mendes
            Assignee: Jiri Cincura


ACTUAL RESULT:
Under certain conditions where network failures can happen more frequently 
(high latency network), the following unhandled exception can happen: 

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
FirebirdSql.Data.Common.IscException: Unable to complete network request to 
host "
No message for error code 335544721 found. ---> System.IO.IOException: Unable 
to write data to the transport connection: An existing connection was forcibly 
closed by the remote host. ---> System.Net.Sockets.SocketException: An existing 
connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, 
SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 
size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 
size)
   at FirebirdSql.Data.Client.Managed.FirebirdNetworkStream.Flush()
   at FirebirdSql.Data.Client.Managed.Version10.GdsStatement.DoFreePacket(Int32 
option)
   --- End of inner exception stack trace ---
   at FirebirdSql.Data.Client.Managed.Version10.GdsStatement.DoFreePacket(Int32 
option)
   at FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Free(Int32 option)
   at FirebirdSql.Data.Common.StatementBase.Release()
   at FirebirdSql.Data.Client.Managed.Version10.GdsStatement.Dispose()
   at FirebirdSql.Data.FirebirdClient.FbCommand.Release()
   at FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at CHRONOS.Models.Databases.FirebirdSQLDatabase.SelectProcedure(String 
procedureName, String[] inputParameters, DataTable dataTable, Boolean 
poolingStatus)



EXPECTED RESULT
This unhandled exception should be redirected to the FbException class.


OHTER INFORMATION
Here is the code of the procedure that the unhandled exception happens:
        private static bool SelectProcedure(string procedureName, string[] 
inputParameters, out DataTable dataTable, bool poolingStatus = true)
        {
            dataTable = new DataTable();
            using (var fbConnection = new FbConnection(ConnectionString()))
            using (var fbCommand = new FbCommand(procedureName, fbConnection))
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    fbCommand.CommandType = CommandType.StoredProcedure;
                    //INPUT PARAMETERS
                    for (var i = 0; i < inputParameters.Length; i++)
                        fbCommand.Parameters.Add("@" + i, 
inputParameters[i]).Direction = ParameterDirection.Input;
                    //OPEN CONNECTION
                    fbConnection.Open();
                    //SELECT PROCEDURE
                    using (var fbDataReader = fbCommand.ExecuteReader())
                        dataTable.Load(fbDataReader);
                    NotifyReconnection();
                    Utility.Log("SP", procedureName);
                    return true;
                }
                catch (FbException ex)
                {
                    if (poolingStatus)
                        return SelectProcedure(procedureName, inputParameters, 
out dataTable, false);
                    else NotifyException(ex);
                    return false;
                }
                finally
                {
                    Cursor.Current = Cursors.Default;
                }
        }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to