Note that there are some explanatory texts on larger screens.

plurals
  1. POSemantics of gwt's requestfactory's RequestContext.edit()
    primarykey
    data
    text
    <p>I wonder if I am right about the semantics of the method RequestContext.edit() (GWT 2.5.1). In my opinion, the alert in the following snippet should never happen. Am I right or just wrong about the semantics of RequestContext.edit()?</p> <pre><code> ICurTournamentPu ctpu = c.getPu(PUK3.curTournament); TourneyProxy origTourney = ctpu.getTourney(); this.tourney = req.edit(origTourney); // TODO begin test { List&lt;DisciplineProxy&gt; otdl = origTourney.getTourneyDisciplines().getList(); List&lt;DisciplineProxy&gt; tdl = tourney.getTourneyDisciplines().getList(); if (otdl != null &amp;&amp; tdl != null &amp;&amp; otdl.size() != tdl.size()) { Window.alert("otdl.size()=" + otdl.size() + " != " + tdl.size() + "=tdl.size()"); } } // TODO end test </code></pre> <p>It appears that a list that is referenced through some links from the editable entity contains more elements than the list that is referenced through the equivalent links from the original non-editable entity. And this happens immediately after the call to RequestContext.edit(). It seems that in some way, old changes from the same client have been preserved even after a refresh from the server. By the way, what would be the defined semantics of the following scenario:</p> <ol> <li>client 1: load an entity e with version 1 and keep it in variable e1</li> <li>client 2: change and persist e</li> <li>client 1: load entity e again (with version 2) and keep it in variable e2</li> <li>client 1: create a RequestContext "req"</li> <li>client 1: editableE1 = req.edit(e1);</li> <li>client 1: editableE2 = req.edit(e2);</li> </ol> <p>What is the defined value of editableE2, then? Same object as editableE1 because already edited in this context? Or a new AutoBean? A little confusing... Can anybody clarify for me? :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload