On Oct 22, 2008, at 11:12 AM, George Domurot wrote:
Agreed.I'm trying to understand this better... when calling application().createContextForRequest(request)... Simon was getting a new session?
No, but he was using a WOComponent to generate the message content for an e-mail and something in the component asked for a session so a new one got created.
We aren't calling this method, so I'm trying to understand other ways such sessions could get created. Any other ideas?
What I always do is to add this to my Session constructor:
NSLog.out.appendln(new RuntimeException("session created"));
Then run your app and look over the many stack traces to find the ones
that are not normal. That should point to where unintended session
creation happens. You could get fancy and create the exception first,
parse the stack trace, and only log if it is not normal. I will leave
that as an exercise for Mike. :-P
Chuck
On Oct 22, 2008, at 10:58 AM, Chuck Hill wrote:On Oct 22, 2008, at 10:46 AM, George Domurot wrote:Is there another technique, possibly from the Application layer to monitor and manage/terminate/destroy these types of sessions automatically?Not that I can think of. I'd vote for not creating them in the first place.ChuckOn Oct 22, 2008, at 10:39 AM, Chuck Hill wrote:On Oct 22, 2008, at 10:34 AM, Simon McLean wrote:Blimey, this has taken me weeks to figure out...We've been plagued with zombie sessions for weeks on a couple of production apps. One, for example, is used by a team of 5 people who sign on in the morning and out in the evening, by which time the app is busy running 300+ sessions!Anyway, after much digging I finally nailed it down to a component that was being used to render email. We use the following method to instantiate a component and then call generateResponse().contentString() to get it's html content:public static WOComponent instantiatePage(String pageName) { // Create a context from a fake requestWORequest request = new WORequest("GET", "", "HTTP/1.1", null, null, null); WOContext context = WOApplication.application().createContextForRequest(request); return WOApplication.application().pageWithName(pageName, context);}The problem was that one of the components used as an email touched the session. I believe because we are using a fake context this results in a new session being created. I'm not sure why those extra sessions don't just expire like normal ones ? But anyway, problem solved. I can sleep again.They weren't created normally in the RR loop so sleep never got called on them. Like a watched pot never boiling, awake sessions never terminate. :-PChuck -- Chuck Hill Senior Consultant / VP DevelopmentPractical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.http://www.global-village.net/products/practical_webobjects _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/george%40boxofficetickets.com This email sent to [EMAIL PROTECTED]-- Chuck Hill Senior Consultant / VP DevelopmentPractical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.http://www.global-village.net/products/practical_webobjects
-- Chuck Hill Senior Consultant / VP DevelopmentPractical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
