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: Jay Walters <jwalters_at_computer.org>
Date: Tue, 09 Mar 1999 11:46:59 -0500
Message-ID: <36E55083.8D52693C@computer.org>


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
Received on Tue Mar 09 1999 - 10:46:59 CST

Original text of this message

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