SQLite and remote access
Posted: Tue 09 Aug 2022 16:17
I have a project that connects to a SQLite database file on a network share. Say I access that file from my application running on MachineA and MachineB. I connect from MachineA, then connect from MachineB. If I try to disconnect from MachineB, the Disconnect procedure waits until MachineA has disconnected.
I have tried various options like setting the ConnectMode to ReadOnly, LockingMode to lmNormal, ReadUncommitted to True etc, using both Direct mode and a SQLite3.dll, but MachineB will still wait for MachineA to disconnect before it can disconnect.
Is there some setting I'm missing? I tried the same code using FireDac, and it works without any issues.
My test code is pretty simple, just the connection component and a button to connect/disconnect:
procedure TfrmMain.btnConnectClick(Sender: TObject);
begin
if connMain.Connected then
begin
connMain.Disconnect;
Self.Caption := 'Disconnected';
end
else begin
connMain.Connect;
Self.Caption := 'Connected';
end;
end;
Thanks in advance.
Ray
I have tried various options like setting the ConnectMode to ReadOnly, LockingMode to lmNormal, ReadUncommitted to True etc, using both Direct mode and a SQLite3.dll, but MachineB will still wait for MachineA to disconnect before it can disconnect.
Is there some setting I'm missing? I tried the same code using FireDac, and it works without any issues.
My test code is pretty simple, just the connection component and a button to connect/disconnect:
procedure TfrmMain.btnConnectClick(Sender: TObject);
begin
if connMain.Connected then
begin
connMain.Disconnect;
Self.Caption := 'Disconnected';
end
else begin
connMain.Connect;
Self.Caption := 'Connected';
end;
end;
Thanks in advance.
Ray