Re-assigning a nested local property migrated out of NEWSESSION for a not-yet-applied object fails with a unique violation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by tracing how nested local property values are copied between sessions and how migrated rows are matched during that copy; the issue does not name source files or tests. Reproduce the described NEWSESSION flow with a nested local property and check whether the object id is used to find an existing row. Done means repeating the assignment for the same object overwrites the migrated value without a unique violation, including when its class is unknown in the receiving session.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
A local property declared DATA LOCAL NESTED is copied back from a NEWSESSION block into the calling session when the block's action finishes. When the action opens a form with NOWAIT, that happens right after the form is opened, so a value the form assigned in ON INIT for an object created in the new session is copied into the calling session before that object is applied. Once the form is saved and the same object is opened again from the calling session, re-assigning the same property for the same object inside the new NEWSESSION fails with a database unique violation on the session table instead of overwriting the value.
CLASS Doc;
name = DATA STRING[50] (Doc);
calc = DATA LOCAL NESTED INTEGER (Doc);
saveDoc () { APPLY; }
FORM doc
OBJECTS d = Doc PANEL
PROPERTIES(d) name, calc
PROPERTIES() saveDoc
EVENTS ON INIT { calc(d) <- 1; }
;
newDoc () { NEWSESSION { NEW d = Doc { name(d) <- 'x'; SHOW doc OBJECTS d = d DOCKED NOWAIT; } } }
editDoc (Doc d) { NEWSESSION { SHOW doc OBJECTS d = d DOCKED NOWAIT; } }
FORM docs
OBJECTS d = Doc
PROPERTIES(d) READONLY name, calc
PROPERTIES(d) editDoc TOOLBAR
PROPERTIES() newDoc
;
Steps:
- Open
docs, runnewDoc:docopens in its own session,ON INITassignscalcfor the new object; because ofNOWAITtheNEWSESSIONends at once and copiescalc, keyed by the not yet saved object, into the session ofdocs. - In
docrunsaveDoc(the object is now in the database). - Back in
docs, refresh, select the object and runeditDoc:ON INITassignscalcfor the same object again.
Result (7.0-SNAPSHOT, master build of 2026-10-18; also reported on 6.3-SNAPSHOT):
Internal Server Error: org.postgresql.util.PSQLException ERROR: duplicate key value violates unique constraint "n0_t_13_pkey"
Detail: Key (k0)=(46138) already exists.
Expected: the assignment overwrites the migrated value, as a second assignment for the same key in one session does.
Declaring the property DATA LOCAL NESTED MANAGESESSION avoids the problem, since such a property is not migrated through NEWSESSION at all.
Reason
Any nested local property that a form assigns in ON INIT makes every later NEWSESSION edit of an object created through the new-and-show pattern fail in the calling form's session; the error names a temporary table and gives no hint of the cause.
Fix
When the values of nested local properties are copied into another session, match the rows by the object id so that a later assignment for the same object updates the migrated row instead of adding a second row with the same key, whether or not the class of the object is known in the receiving session at the time of the copy.
- Lingua principale
- Java
- Stelle
- 214
- Fork
- 46
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lsfusion/platform
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
Tutte le issue di lsfusion/platform
Issue simili
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
app:learninggoalhub enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyForse già presa @vaibhavgupta443 l’ha presa oggi. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/wicket#1991 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100