Search the Community
Showing results for tags 'omnithreadpool'.
Found 2 results
-
OmniThreadLibrary Issue - WaitFor() Doesn't executes the task for some random records
Hrushikesh Shet posted a topic in OmniThreadLibrary
We are working on a legacy application that is built using Delphi XE6. We have used the Omni Thread library and have version 3.05: 2015-09-07 installed. We are facing an issue while executing this OTL code. When the control reaches line aTaskControl.WaitFor(10000); it doesn't execute any task. It skips and terminates the thread. This is happening randomly and more specifically in our Production environment whereas in the Dev environment it works fine. In our task, we are connecting to our database and performing some checks and updating the records based on some business logic. Any inputs or suggestions will be really helpful and appreciated. Thanks.-
- omnithread
- otl
-
(and 1 more)
Tagged with:
-
Hi all, Is it possible I have a race condition in a thread pool ? when I launch a task, I get a database connection from my database factory, but when the worker want to use it, Sometimes I've got an error message "mysql server has gone away", if I'm retrying after few sec, I didn't get the error message again, everything is working. Is there a specific status that a Thread from the thread pool is going to be destroyed ? Thanks Patrick FPoolSearch is definined as iOmniThreadPool; procedure TFrameCustomer.SearchForId(aValue : integer); var Params : TParameters; const cParam = 'I_IDCLI'; begin WithParamsReset(Params); WithParam(Params,cParam, aValue ,dtInteger); CreateTask(WorkerSearchId, GetTGUIDString ) .OnMessage(TaskMessage) .OnTerminated(TaskTerminated) .SetParameter('Params',TOmniValue.FromArray<rParameter>(Params)) .SetParameter('ProcName','prc_ClientSearchId') .Schedule(FPoolSearch); end; {------------------------------------------------------------------------} procedure WorkerSearchId(const task: IOmniTask); function FillData : TFCustomer; var aCust : TFCustomer; begin result:=TFCustomer.Create; with (task.ThreadData as TConnectionPoolData) do begin with DM.Proc do // Datamodule . Procedure begin WorkOnParams; // Inject parameters from the procedure Open; if RecordCount>0 then FilInfo(result,task); end; end; end; var aOVValue : TOmniValue; aRes : TFCustomer; begin (task.ThreadData as IConnectionPoolData) .WithProcedureName(task.Param['ProcName']) .WithParameters(task.Param['Params']); aRes := FillData; aOVValue := TOmniValue.CastFrom<TFCustomer>(TFCustomer.Clone(aRes)); aRes.Free; task.Comm.Send(MSG_SHOW,aOVValue); end;