Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Table not being released when closed..
Mon, Aug 8 2022 3:19 AMPermanent Link

Ian Branch

Avatar

Hi Team,
During an App OnShow event I open a table, get a piece of data from it and close it.
Unfortunately, it seems the table isn't released. Frown It is still flagged as 'In Use' by a routine I use.
{code}
function IsFileInUse(const FileName: string): Boolean;
var
 hf: THandle;
begin
 hf := CreateFile(PChar(FileName), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
 if hf <> INVALID_HANDLE_VALUE then
 begin
   CloseHandle(hf);
   Result := False;
 end
 else
 begin
   Result := (GetLastError() = ERROR_SHARING_VIOLATION);
 end;
end;
{code}

This might be normal. Frown
If it is, is there a work around?

Regards & TIA,
Ian
Tue, Aug 9 2022 2:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Is KeepConnections set to True in the sessions component? If so that might be it. All I can think of.

Roy Lambert
Tue, Aug 9 2022 3:18 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Thanks for the suggestion.  Turns out you probably meant KeepTablesOpen, which was/is true.
Trouble is there is a possible performance issue if KeepTablesOpen is False.
I don't know what impact there may be in actuality.

Ian
Image