Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to manage sessions with OAS 4 / JWeb cartridge?

Re: How to manage sessions with OAS 4 / JWeb cartridge?

From: <basc5_at_my-dejanews.com>
Date: Wed, 10 Mar 1999 23:09:18 GMT
Message-ID: <7c6u2l$jqq$1@nnrp1.dejanews.com>


I am having the same problem. Below is an example of my class. As you can see, I tried to keep it as simple as possible. Here is the scenario that I am having problems with:

  1. Point browser to JWeb class
  2. Screen states "Counter: 0"
  3. Wait for the cartridge to timeout (set to 60 seconds)
  4. Click reload on browser
  5. Screen states that the session has timed out 6 Click reload again on browser
  6. Screen states "Counter: 1"

I have the JWeb class in the "physical path" and not the classpath, but this still happens! Any thoughts?

BTW, do you know the optimum instance/thread settings for doing this type of session management with JWeb cartridges? Any info would be greatly appreciated!

-Bryan

In article <36E55083.8D52693C_at_computer.org>,   Jay Walters <jwalters_at_computer.org> wrote:
> You are 99% of the way there - you need to put the class HelloWorld or
whatever it
> is called on the physical path, not the classpath. Not sure if I got the term
> right, but the physical path is the directory which the virtual path resolves
to
> in the JWeb setup. Statics are session specific in those classes loaded from
the
> physical path, but are VM specific (or what we're all used to) when the class
is
> loaded from the CLASSPATH.
>
> mschupp_at_ixl.com wrote:
>
> > it sounds like you have specifically used 'static' on an object that you
would
> > actually want to keep multiple copies of..
> >
> > try removing static from your 'stateful object' ..
> > -s
> >
> > In article <36DA279A.4D02D2FE_at_nycap.rr.com>,
> > David Smith <dr_smith_at_nycap.rr.com> wrote:
> > > I have a newbie OAS/Jweb question, regarding session management:
> > >
> > > I can't seem to get sessions working the way I want.
> > > What I want to have happen is this: My OAS Java application
> > > instantiates a stateful object. I want each user (each web
> > > browser) to get their own private one of these stateful objects.
> > >
> > > This seems like it should be simple. It is simple, for example,
> > > with ASP. (But I digress...)
> > >
> > > From reading the docs, I thought I could make this one-object-per-user
> > > scenario happen if I (a) use OAS manager to enable sessions, and
> > > (b) make the object static.
> > >
> > > Well, I've enabled sessions, and my object (a member variable
> > > in my helloWorld.java) is static. The first time a user hits
> > > the web site URL, OAS/Jweb instantiates my stateful object;
> > > okay so far. But then, when a second user accesses the web site,
> > > it seems that OAS is using the first user's session to respond to
> > > the 2nd user's request. In other words, when helloWorld.java
> > > executes for user #2, helloWorld's member variable, m_myObject,
> > > has already been instantiated (it was instantiated by user #1).
> > >
> > > I can see how this behavior would be desirable in some contexts
> > > (like, if you wanted to maintain a counter of how many hits
> > > you've had). But in my situation, I want each user to get a
> > > separate object instance.
> > >
> > > Is there something special I have to do to make OAS assign a
> > > separate instance to each unique visitor?
> > >
> > > Thanks
> > > - Dave
> > > p.s. To reply to me by direct e-mail, please remove "_" (underscore)
> > > from my email address.
> > >
> >
> > -----------== Posted via Deja News, The Discussion Network ==----------
> > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Mar 10 1999 - 17:09:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US