Icon View Incident Report

Minor Minor
Reported By: Christian Sanggaard
Reported On: 4/21/2004
For: Version 4.05 Build 1
# 1675 Remote Sessions Not Properly Aborting Remote Operations When Reconnects Disabled

When my application received an 11276 error, it close the session and returns false with "StayConnected" and false with Continue". The application freeze and nothing happen, after the close procedure has been called. I tried to log the events, and I register that the session component called the "RemoteTimeOut" once.

procedure TForm1.Button1Click(Sender: TObject);
begin
  NetworkErr := false;
  DBISAMSession1.RemoteTimeout := 30;
  Table1.Active := True;
  showmessage('Connected');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  DBISAMSession1.Active := false;
  showmessage('Disconnected');
end;

procedure TForm1.ApplicationEvents1Exception(Sender: TObject;
  E: Exception);
begin
  if NetworkErr then
    Exit;

  if E is EDBISAMEngineError then
    with E as EDBISAMEngineError do
      NetworkErr :=
        (ErrorCode = DBISAM_REMOTECOMMLOST) or
        (ErrorCode = DBISAM_REMOTECONNECT);
  if NetworkErr then begin
    application.ProcessMessages;
    showmessage('Network error. Disconnecting...');
    try
      screen.Cursor := crHourGlass;
      Button2Click(nil);
    finally
      screen.Cursor := crDefault;
    end;
  end else
    with Application do
      MessageBox(PChar(E.Message),PChar(Title),
                 mb_Ok or mb_IconExclamation);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Table1.First;
  showmessage('done');
end;

procedure TForm1.DBISAMSession1RemoteReconnect(Sender: TObject;
  var Continue: Boolean);
begin
  if networkErr then
    Continue := False;
end;

procedure TForm1.DBISAMSession1RemoteTimeout(Sender: TObject;
  var StayConnected: Boolean);
begin
  if networkErr then
    StayConnected := False;
end;



Comments Comments
The problem was that the remote session was trying to reconnect and when the OnRemoteReconnect was fired, it was not properly aborting the operation and the subsequent operations tried to use non-existent resources. The result was AVs, which are evidenced in the code example above.


Resolution Resolution
Fixed Problem on 4/22/2004 in version 4.06 build 1
Image