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 -> How to manage sessions with OAS 4 / JWeb cartridge?

How to manage sessions with OAS 4 / JWeb cartridge?

From: David Smith <dr_smith_at_nycap.rr.com>
Date: Mon, 01 Mar 1999 05:34:14 GMT
Message-ID: <36DA279A.4D02D2FE@nycap.rr.com>


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. Received on Sun Feb 28 1999 - 23:34:14 CST

Original text of this message

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