Thanks John.
But how would that work in a multi-user setting? Whatever method is used
for assigning the new numbers, it must run on the server, otherwise we're
back to the problem of using semaphores, checking record locking, etc.
Also I should point out that there could be a large number of tables for
which the record numbering system needs to be used. We have a RecordNumbers
table which has one record for each table that requires this function. so
we must have ONE process that accesses and updates that table.

On Sat, 25 Aug 2018 at 15:49, John DeSoi via 4D_Tech <>

> > On Aug 25, 2018, at 9:10 AM, Pat Bensky via 4D_Tech <
>> wrote:
> >
> > As I see it, we'll need to call a worker, which calls the worker that
> > assigns the record number.
> > The first worker has to wait until the second one has created the new
> > number.
> > Then the original method, that called the first worker, must wait until
> the
> > first worker  gets the new number. It seems that this won't be much
> better
> > than the old method.
> >
> > Am I completely barking up the wrong tree? Is this not an appropriate use
> > for workers? Or have I misunderstood something?
> It would have been really nice if CALL WORKER was implemented like EXECUTE
> METHOD and could return a value. You can do this on your own, but it is
> quite a bit  of work to do it in a general way.
> For your application, all you need is a shared object (no worker needed).
> Only one process at a time will be able to modify the counter. Some startup
> method could initialize the counter to the starting value.
> Use (Storage.myCounter)
>   Storage.myCounter.value:= Storage.myCounter.value+1
>   $0:= Storage.myCounter.value
> End use
> John DeSoi, Ph.D.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:
> Options:
> Unsub:
> **********************************************************************

CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
skype: pat.bensky
4D Internet Users Group (4D iNUG)

Reply via email to