Page 1 of 1

After migration from v9.4.3 to v10.0.2, SDAC raises error 'Not enough timers available' in thread

Posted: Mon 24 Jan 2022 11:22
by createmark
Hi!

To reproduce it place on form
MSConnection
MSQuery

Set MSQuery1.Options.NonBocking := True
Set MSQuery1.SQL.Text any SELECT query

Add code below in button on click and execute the code

TThread.CreateAnonymousThread(
procedure
begin
CoInitialize(nil);
try
MSQuery1.Close;
MSQuery1.Open;
finally
CoUninitialize;
end;
end).Start;

set debug point on MSQuery1.Close and run (F9) in debug mode, on first executing (click button) this code it's ok but on second executing (click button) you will see error 'Not enough timers available' on line 'MSQuery1.Close'.

This problem happened in CRTimer unit in code

procedure TCRTimer.UpdateTimer;
begin
KillTimer(FWindowHandle, 1);
if (FInterval <> 0) and FEnabled and Assigned(FOnTimer) then
if SetTimer(FWindowHandle, 1, FInterval, nil) = 0 then
raise EOutOfResources.Create(SNoTimers);
end;

What was changed in SDAC that components brings this error and how to fix it? Also, as I understand that NonBocking options is used especially for threads but now looks like NonBocking := false works good.

Thank you.

Re: After migration from v9.4.3 to v10.0.2, SDAC raises error 'Not enough timers available' in thread

Posted: Mon 31 Jan 2022 12:57
by Stellar
Hi there,

Thank you for contacting Devart!

When the NonBocking option is enabled, row fetching is performed on a separate thread.
Since your entire request is executed in a separate thread, you do not need to use NonBocking mode.

More details about NonBocking mode here:
https://docs.devart.com/sdac/devart.sda ... ocking.htm

Let us know if you have any other questions!

Re: After migration from v9.4.3 to v10.0.2, SDAC raises error 'Not enough timers available' in thread

Posted: Tue 01 Feb 2022 18:47
by createmark
Thank you! Yes, NonBlocking := False works well.

Re: After migration from v9.4.3 to v10.0.2, SDAC raises error 'Not enough timers available' in thread

Posted: Wed 02 Feb 2022 13:30
by Stellar
Hi,

Thank you for your reply! I was happy to assist you!
In case you have any further questions about our products, please feel free to contact us any time!

Best regards,
Sergey