This content has been marked as final.
Show 2 replies
-
1. Re: getting a StaleObjectStateException
deanhiller2000 Jul 18, 2008 9:29 AM (in response to deanhiller2000)oh yeah, my closePosition is in an EVENT scoped bean and the list is in a SESSION scoped bean as I guess that state has to be in conversation, session or appliation so the event bean can be passed item X from the list to the method.....I wonder if therein lies the problem???? does the session bean keep that stuff cached and the versions are all still the old versions, but even then, the list would not be read after the transaction....how to make the list get read after the mgr.merge method call and the tx commit? so the list has the most recent versions of data?
-
2. Re: getting a StaleObjectStateException
gjeudy Jul 18, 2008 4:12 PM (in response to deanhiller2000)reformatted for readability:
@DataModel private List<EmployerPosition> openPositions; @DataModel private List<EmployerPosition> otherPositions; @Factory("openPositions") public void fillInPositions() { Employer newEmployer = mgr.merge(employer); List<EmployerPosition> positions = newEmployer.getImmutableEmployerPositions(); openPositions = new ArrayList<EmployerPosition>(); otherPositions = new ArrayList<EmployerPosition>(); for(EmployerPosition pos : positions) { if(pos.getState() == EmployerPositionState.OPENED) openPositions.add(pos); else otherPositions.add(pos); } }
The problem exposition is not clear, can you please provide more info such as your bean declarations, facelets snippets and stacktrace ?