Re: Java Monitor Sessions Question
Re: Java Monitor Sessions Question
- Subject: Re: Java Monitor Sessions Question
- From: Arturo PĂ©rez <email@hidden>
- Date: Wed, 28 Apr 2004 21:57:51 -0400
On Apr 28, 2004, at 9:41 PM, James Cicenia wrote:
Ahhh very interesting. I use no DirectActions, at least not explicitly.
The issue discussed in the below response is an issue only for
DirectActions. That is, most people who build applications with mostly
DAs do so to avoid session creation. So, since you don't have DAs then
that's not relevant to you.
But, I do hit session a lot! Half my app uses the current selection all
the time. Heck I even thought it was encouraged being as it is always
the default object in WOBuilder.
I have the current portfolio, project and user in session and access
them via ((Session)session()).user();
That should be fine. If you were hitting new sessions all the time
then the data you're expecting to be there wouldn't.
What is the proper approach here?
It sounds to me like you're doing fine. One issue with sessions is
that the Web/HTTP doesn't really have a bulletproof way to indicate to
a web application that the session is over.
If you're worried, you could try reducing your session timeout. Other
things include putting in logout buttons (that most users never hit)
and making sure the homepage (starting page) doesn't create sessions
until someone logs in.
Me, I like sessions. But I like big honking hardware, too :-)
-James Cicenia
On Apr 28, 2004, at 3:56 PM, Jonathan 'Wolf' Rentzsch wrote:
James Cicenia, email@hidden, wrote:
My active sessions in JavaMonitor seem awfully high considering there
is only one person testing the application.
I see 14, 22 etc.
Is it correct? Is my program not releasing sessions? (Say a close
window from one of my popups?)
Use a lot of DirectActions? Hitting session() -- either explicitly in
your code or implicitly though certain stock WOComponents -- will
lazily
create a session.
I have a deployed app that should almost never create a session. So, I
log a warning message whenever a session is created:
import org.apache.log4j.Logger;
public class Session extends WOSession {
private static Logger log = Logger.getLogger( Session.class );
public Session() {
super();
log.warn( "session created" );
}
public Session(String sessionID) {
super(sessionID);
log.warn( "session created" );
}
}
This technique can help you narrow down where all those sessions are
coming from.
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.