Thanks Keisuke,

I modified my code so:
 First i use CREATE SELECTION FROM ARRAY
If i have error -10053, i use:

$R:=SIZE OF ARRAY($aArray)

CREATE EMPTY SET([TABLE];"SET")
FOR ($I;1;$R)
    GOTO RECORD([TABLE];$aArray{$I})
    ADD TO SET ([TABLE];"SET")
END FOR

USE SET

And  he work.

I can try to use LONGINT ARRAY TO SELECTION for save records number of a selection of records and see if i have the same issues.

I have noticed that if before i delete some order in the table that i need to use, the command CREATE SELECTION FROM ARRAY work well, ( perhaps why 4D ENGINE have some deleted orders to reuse ). But if 4D engine has completely new orders to create CREATE SELECTION FROM ARRAY can give these issues, especially if I create more than one new orders.

Thanks

Ferdinando

Il 26/07/19 03:34, [email protected] ha scritto:
Message: 9
Date: Fri, 26 Jul 2019 01:15:00 +0000
From: Keisuke Miyako<[email protected]>
To: 4D iNug Technical<[email protected]>
Subject: Re: REATE SELECTION FROM ARRAY
Message-ID:<[email protected]>
Content-Type: text/plain; charset="utf-8"

CREATE SELECTION FROM ARRAY doesn't write any records,
so I don't think locking is the problem.

https://doc.4d.com/4Dv17R5/4D/17-R5/CREATE-SELECTION-FROM-ARRAY.301-4127676.en.html

I am a bit concerned about the description

1 - Client_1 create the record.
I assume you take care of the fact that the record number is invalid until it 
is saved.

2 - At the same time, Client_2 run a loop process every two seconds,
that search if there are new records using QUERY command.
how exactly do you decide that a records is new?

---

I can understand the feature requirement;
you want to live-update a list of records.

but, polling is generally not the best way to do it.

---

aside from that,

I know SELECTION TO ARRAY using the 1st syntax
seems identical to LONGINT ARRAY FROM SELECTION
but perhaps the command is somewhat incompatible with CREATE SELECTION FROM 
ARRAY,
in certain cases (just guessing).

maybe you could replace SELECTION TO ARRAY
with LONGINT ARRAY FROM SELECTION.

but CREATE SELECTION FROM ARRAY is designed to throw error -10503 (documented)
so in that sense there is nothing wrong with your code.


**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to