SQL Worker

Phil (OmnisList) phil at pgpotter.co.uk
Mon Nov 28 09:28:02 UTC 2022


Hi Das,

If you do a loop to init a single worker, it will probably reset after 
the first one...
you can re use it, but only after it completes its first operation.

ie a normal loop is not a way to do it.

If you have a number of known sql commands it can run a whole list of 
SQL commands, and when they are all complete, it will return any results 
all together, for you to decipher after the event.

The Omnis Samples have one for SQL Worker Objects showing this...

Documents online might explain better:
javascript:load('/developers/resources/onlinedocs/Programming/07sqlprog.html#creating-sql-worker-objects')

But basically, for a worker, you go ask it to do a job, and then forget 
it, assume it won't be available whilst you continue the rest of the 
current method...

You could ask that one worker to do a number of SQL commands, if that 
fits your purpose, or if not, then you need multiple worker objects.

regards
Phil Potter
Based in Chester in the UK.

On 27/11/2022 18:10, Das Goravani wrote:
> Hi
>
> I’m using Studio 10.1 on this.
>
> What is the correct way to fire off a bunch of SQL Workers?
>
> Do you have one worker object or object ref, and then in a repeat loop you use that one over and over?
>
> Or do you make a new one for each iteration of your loop?
>
> I am new to the SQL Worker.
>
> I have it so far working for the first firing.. it completes, but the second one dives into an not(lbOK) catch after the $init method as if something is wrong with using the object twice in a row.
>
> Thanks
>
> Das Goravani
>
> Ps: Hope you had a good holiday!
> _____________________________________________________________
> Manage your list subscriptions athttps://lists.omnis-dev.com
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com  


More information about the omnisdev-en mailing list