Re: Avoiding session creation for DirectActions

2016-06-01 Thread Musall Maik
Thanks everyone. existingSession() seems pointless in my case, as it will always return null for these actions, because there is no way for the callers to identify an existing session. I'm currently experimenting with stateless components. I didn't really look at this from the perspective of

Re: Avoiding session creation for DirectActions

2016-05-31 Thread Mark Wardle
Don’t create sessions in your Direct Actions. Use existingSession() rather than session() (latter will create one if there isn’t one). For example: /** * Do we have a current and valid logged in user? * This method is careful not to create a session if one does not

Re: Avoiding session creation for DirectActions

2016-05-31 Thread Hugi Thordarson
…but if you want to discover where sessions are being created, Application.createSessionForRequest() is certainly an excellent way to do it. @Override public WOSession createSessionForRequest( WORequest request ) { Thread.dumpStack(); return super.createSessionForRequest( request

Re: Avoiding session creation for DirectActions

2016-05-31 Thread Hugi Thordarson
Hi Maik, Sounds like your application doesn't actually need sessions. I’d start by looking at where sessions are being created and then try to eliminate session creation altogether. Unless session() is explicitly invoked in your DAs or components, requests will generally not create new

Re: Avoiding session creation for DirectActions

2016-05-31 Thread Michael Kondratov
Maik, Why not use stateless components and avoid session creation all together? Michael Kondratov Aspire Auctions, Inc. 216-231-5515 > On May 31, 2016, at 11:35 AM, Musall Maik wrote: > > Hi all, > > in an application that gets frequent DirectAction calls from