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
Unhandled exception at FirebirdSql.Data.Client.Managed.FirebirdNetworkStream.Flush() [DNET1014] #927
Comments
Commented by: @luronumen Suggestion: |
Commented by: @luronumen Hi Jiri, Any news about this bug? Best Regards, |
Commented by: @cincuranet At the moment I'm working on finishing the v8.0. I'll fix that maybe into 8.0 maybe into next version. Seems straightforward enough to put it into 8.0, we'll see. |
Commented by: @luronumen Thank you very much for your understanding, Jiri! Best Regards, |
Commented by: @luronumen This issue is reproducible in version 8.0.0-alpha3 but the error message is slightly different: ======================================== ************** Exception Text **************
|
Modified by: @cincuranetFix Version: vNext [ 10982 ] |
@luronumen Would you mind trying this build to see everything behaves as expected? |
Hi @cincuranet How can I download FirebirdSql.Data.FirebirdClient.dll from this site? First of all thank you very much for working to fix this issue! |
Both NuGet and the dll are in this. |
Hi @cincuranet The issue is still reproducible on this version. See: ERROR.txt |
That looks correct. Now the exception is |
Hi @cincuranet You mean this error has to be handled in my code? Do you know how I can improve it to catch this exception? Thanks in advance, |
Yes. You need the try-catch block around the |
Hi @cincuranet You means like that: SelectProcedureNewVersion.txt |
Yes, that's one way to do it. |
Done in 836ba7a. |
Hi @cincuranet I retested this issue using this build version and this SelectProcedureNewVersion.txt version and the issue is no longer reproducible! Thank you very much for the fix! Best Regards, |
Submitted by: @luronumen
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;
}
}
The text was updated successfully, but these errors were encountered: