#1 2017-12-14 05:41:01

Ghiber
Member
Registered: 2016-02-17
Posts: 14

Problem with Fmx Client using Execute SQL via services

Hi, I'm trying to implement the Samples \ 16 - Execute SQL via services for a cross-platform client in delphi fmx, works fine without using

.SetOptions ([], [optExecInMainThread, optFreeInMainThread]) on the server, trying not to generate a new connection to the sqlserver every time I run a query on the client side, but when I use optExecInMainThread, calls to the methods from The client does not work, What am I doing wrong. Thank you.

Offline

#2 2017-12-14 11:40:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Problem with Fmx Client using Execute SQL via services

To work in the main thread, you need a processing loop in the main thread.

Offline

#3 2017-12-14 14:05:03

Ghiber
Member
Registered: 2016-02-17
Posts: 14

Re: Problem with Fmx Client using Execute SQL via services

ok thank you I will try, and congratulations for your great framework

Offline

#4 2017-12-14 16:08:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Problem with Fmx Client using Execute SQL via services

FYI

Classes.pas documentation wrote:

{  Call CheckSynchronize periodically within the main thread in order for
   background threads to synchronize execution with the main thread.  This
   is mainly for applications that have an event driven UI such as Windows
   or XWindows (Qt/CLX).  The best place this can be called is during Idle
   processing.  This guarantees that the main thread is in a known "good"
   state so that method calls can be safely made.  Returns True if a method
   was synchronized.  Returns False if there was nothing done.
}
function CheckSynchronize(Timeout: Integer = 0): Boolean;

Offline

#5 2017-12-14 22:13:43

Ghiber
Member
Registered: 2016-02-17
Posts: 14

Re: Problem with Fmx Client using Execute SQL via services

Thank you very much for the help, now solve, everything was in the procedure ConsoleWaitForEnterKey both the loop with the function CheckSynchronize. I already have running the example 16 in windows, linux, android.

Offline

Board footer

Powered by FluxBB