• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: When a session is created?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When a session is created?


  • Subject: Re: When a session is created?
  • From: Mark Ritchie <email@hidden>
  • Date: Mon, 20 Jun 2005 08:53:05 -0400

On 20-Jun-05, at 2:59 AM, Sébastien Gruhier wrote:
I would like to know when a session is supposed to be created because I have noticed that a new session is created on each submit of a form.

Hi Sébastien,

If this problem happens every time then I would use the debugger and set a break point on session creation to see what's happening.

When that's not the case, when it happens intermittently then I sometimes resort to something like this.  I override the session constructor and log when the session is created, it's sessionId and the stackTrace so I can see exactly how the session is being created.  This has been very enlightening over the years.  I hope it helps:

    public Session() {
        super();
        
        String message = "Session created (sessionID:" + sessionID() + ")";
        NSLog.err.appendln(message);
        new Exception(message).printStackTrace();
    }

When a session is created in response to a component action, the output will look something like this:
[2005-06-20 08:25:00 EDT] <WorkerThread0> Session created (sessionID:AVSmK1ZBBYLDgt2uI3GbYw)
java.lang.Exception: Session created (sessionID:AVSmK1ZBBYLDgt2uI3GbYw)
    at Session.<init>(Session.java:18)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:308)
    at java.lang.Class.newInstance(Class.java:261)
    at com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:577)
    at com.webobjects.appserver.WOApplication.createSessionForRequest(WOApplication.java:1611)
    at com.webobjects.appserver.WOApplication._initializeSessionInContext(WOApplication.java:1752)
    at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:309)
    at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)
    at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)
    at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
    at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
    at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
    at java.lang.Thread.run(Thread.java:552)


Good Luck!
Mark.
__
Mark Ritchie
Diamond Lake Consulting Inc.
Toronto, Ontario, Canada
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: When a session is created?
      • From: Chuck Hill <email@hidden>
References: 
 >When a ssesion is created? (From: Sébastien Gruhier <email@hidden>)

  • Prev by Date: Re: No "--" in comments: something new in Java, Project Builder or WO ?
  • Next by Date: Re: newbie needs help/advice
  • Previous by thread: When a ssesion is created?
  • Next by thread: Re: When a session is created?
  • Index(es):
    • Date
    • Thread