Re-assigning a nested local property migrated out of NEWSESSION for a not-yet-applied object fails with a unique violation
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 214
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lsfusion/platform
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
All issues in lsfusion/platform
Similar issues
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
app:learninggoalhub enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPossibly taken @vaibhavgupta443 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1991 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100