ADO.NET Data Provider - Unhandled Exception

10 views
Skip to first unread message

Luciano Rodrigues Nunes Mendes

unread,
Feb 2, 2021, 9:07:42 AMFeb 2
to firebird-support
Hi everyone,

I have software written in C# that uses the ADO.NET data provider library and sometimes the following exception happens when trying to run a query or update or insert:

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)

I've tried to catch this exception with a try/catch(FbException ex) block in the CHRONOS.Models.Databases.FirebirdSQLDatabase.SelectProcedure method but it never catches this FbException.

Should the ADO.NET data provider library catch this exception? Should I open a bug to fix the ADO.NET data provider library?

Thanks in advance,
Luciano

Dimitry Sibiryakov

unread,
Feb 2, 2021, 9:47:33 AMFeb 2
to firebird...@googlegroups.com
02.02.2021 15:07, Luciano Rodrigues Nunes Mendes wrote:
> FirebirdSql.Data.Common.IscException: Unable to complete network request to host

> I've tried to catch this exception with a try/catch(FbException ex) block

I don't know C#, but "IscException" seems to have a couple of different letters from
"FbException".

--
WBR, SD.

Mark Rotteveel

unread,
Feb 2, 2021, 1:29:39 PMFeb 2
to firebird...@googlegroups.com
On 2021-02-02 15:07, Luciano Rodrigues Nunes Mendes wrote:
> Hi everyone,
>
> I have software written in C# that uses the ADO.NET data provider
> library and sometimes the following exception happens when trying to
> run a query or update or insert:
>
> 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 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)
>
> I've tried to catch this exception with a try/catch(FbException ex)
> block in the
> CHRONOS.Models.Databases.FirebirdSQLDatabase.SelectProcedure method
> but it never catches this FbException.
>
> Should the ADO.NET data provider library catch this exception? Should
> I open a bug to fix the ADO.NET data provider library?

Questions about the Firebird ADO.net provider should go to the
firebird-net-provider Google Group,
https://groups.google.com/g/firebird-net-provider.

Generally, the ADO.net provider should not catch exceptions for you.
This exception informs you as the user of the ADO.net provider that
something went wrong. In this case, it looks like the connection was
forcibly closed (which could happen if the server crashes, or a firewall
terminates a connection, or something like that).

Mark
Reply all
Reply to author
Forward
0 new messages