On 19 May 2024, at 5:55 am, o...@ocs.cz wrote: > Hmmm... can you recall please some scenarios, which lead to the spectacular > failure?
I'm talking only about ERPersistentSessionStorage.framework, and runtime failures occur whenever it hits something in the object graph rooted at your Session that isn't Java-serializable for any reason (including EOs, components, objects from Wonder, objects from your codebase). The most recent thread on this seems to be "WOSession serialisation redux" started by me on 19 May 2015. Ramsey thought at the time that he'd made Wonder-side fixes to bring it all "about 95% there". Of course, there's now 9 years of additional commits and bit-rot, but maybe it's still around that mark. Then there's your code, everything in your Sessions, EOs, and components. You can always give it a try and see what happens, but if you're only "about 95% there", that's a lot of unrecoverable, runtime failures to store your sessions. I wasn't talking about anything you're doing below. > Based on the ER source code and some Ramsey suggestionst (thanks again!) I've > found a way which so far, tested just for a short time only at my side, seems > to work reasonably well — here's the gist, without error checking, logging > and other cosmetics: > > === > class OCSSession extends ERXSession { > WOContext lastContext > void sleep { > if (context.page) lastContext=context.clone() > super.sleep() > } > } > > class OCSDirectAction extends ERXDirectAction { > WOActionResults restorePreviousStateAction { > Session ss=session() > if (ss.lastContext) { // code essentially stolen from > ERD2WDirectAction > String cid=ss.lastContext.request.stringFormValueForKey('__cid') > if (cid) return ss.restorePageForContextID(cid) > if (ss.lastContext.page) return ss.lastContext.page > } > pageWithName(MainPage.class.name) > } > } > === > > If you can foresee case(s) when it would fail, I'd be grateful for some > hints, so that I test them here and update my code appropriately. > > Thanks again and all the best, > OC -- Paul Hoadley https://logicsquad.net/ https://www.linkedin.com/company/logic-squad/
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com