Subject Re: [firebird-support] udf dll
Author Robert Tulloch
On 12/12/2018 12:34 PM, Dimitry Sibiryakov sd@... [firebird-support] wrote:
12.12.2018 18:05, Robert Tulloch tultalk@... [firebird-support] wrote:
Error message when run from program in IDE
First chance exception at $7C812FD3 . Exception class EIBInterBaseError with message 
'Unable to complete network request to host "ws1".
Error writing data to the connection.
   Your UDF crashed server most likely.

An established connection was aborted by the software in your host machine.
   10053? Wow... What is exact version of client library was in use?

'. Process IBConsole.exe ($A54)
   This is an Interbase client tool, not Firebird one. Do you by chance try to use 
Interbase client library to access Firebird server? This is no-go.

Explain:

Not using firebird at all.

Used IB 6 (6.0.2.0) for many years. Old apps D5/BCB5 (hobby).

Installed BCB5 app I did in 2000 on Win10. All worked fine.Went to githgub and downloaded source for console and decided to put it back together with enhancements (hobby like model airplanes).

Integrating Planalyzer into IBConsole. 50% there maybe.

Did not have COELESCE() in IB 6 so wrote new UDF to perform function thus the crash.

As I said in previous post:

Stepped to error block

function TIBTransaction.Call(ErrCode: ISC_STATUS;
  RaiseError: Boolean): ISC_STATUS;
var
  i: Integer;
begin
  result := ErrCode;
  for i := 0 to FDatabases.Count - 1 do if FDatabases[i] <> nil then
    Databases[i].FCanTimeout := False;
  FCanTimeout := False;
  {Handle when the Error is due to a Database disconnect.  Pass it on to
   FDatabase so it can handle this}
  if CheckStatusVector([isc_lost_db_connection]) then
    FDefaultDatabase.Call(ErrCode, RaiseError)
  else
    if RaiseError and (result > 0) then
      IBDataBaseError;
end;


Why it disconnects? Who knows but I will track it down.