You are not logged in.
Hi everyone, I'm using the TDDDMonitoredDaemonProcessRest class to monitor some update states within the system. This monitoring takes place on a field changed via trigger directly in the database. The problem is that orm only recognizes the changes when I start the server, then all subsequent changes are not recognized by orm.
Is there any kind of refresh from TSQLRecord?
See the code excerpt below:
function TProductDaemonProcess.ExecuteRetrievePendingAndSetProcessing: boolean;
begin
fPendingTask := (fDaemon as TSyncProdutoIntegraDaemon).RestClass.Create(
fDaemon.Rest,'IdWooCommerce>0 and (SyncSupraWoo=? or SyncSupraWoo is null)',['N']);
if fPendingTask.ID=0 then begin
result := false;
exit;
end;
end;
Offline
Hi, Ab
The TDDDMonitoredDaemonProcessRest class serves to monitor the state of some field in a table and perform an action on the value contained in this field, right?
When the change in the value of this field being monitored occurs via trigger directly in the database, this change is not seen by TSQLRecord.
This way, when this SyncSupraWoo field is receiving a value directly from a trigger in the database, fPendingTask is never created. Understood?
Offline
Has anyone ever experienced this?
Offline
TDDDMonitoredDaemonProcessRest has nothing to do directly about "monitoring the state of some field in a table".
It is about running some background process, with start/stop and state abilities.
Offline
hi ab,
Maybe I expressed myself wrongly. When I say monitor I am referring to the ExecuteRetrievePendingAndSetProcessing method which is checking the value of a given field to return true or false. that's the concept of pendingtask isn't it? or am I mistaken?
Offline
Your TProductDaemonProcess.ExecuteRetrievePendingAndSetProcessing returns false in the last then begin...end but leave result unset.
It should return true or false.
The global logic is in TDDDMonitoredDaemonProcess.Execute.
One example of use is TDDDEmailerDaemonProcess.
Offline
That's right Ab, in TDDDEmailerDaemonProcess who the method's True or False result is controlled according to the value of TSQLRecord's State field.
fPendingTask := (fDaemon as TDDDEmailerDaemon).RestClass.Create(
fDaemon.Rest,'State=? order by RowID',[ord(esPending)]);
that's exactly what doesn't work in my case, when the value of this field is changed by a trigger in the Bank a some manual update.
TSQLRecord in my case doesn't recognize that the field value has changed, so the method never returns True.
Offline
Hi Ab, I found out that the problem is related to my mounted where clause.
It does not work:
IdWooCommerce>0 and (SyncSupraWoo=? or SyncSupraWoo is null)
but it works:
SyncSupraWoo=? or SyncSupraWoo is null
I can't use clause and with or.
Offline