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: <mschupp_at_ixl.com>
Date: Tue, 09 Mar 1999 14:46:54 GMT
Message-ID: <7c3c8q$dgr$1@nnrp1.dejanews.com>


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 - 08:46:54 CST

Original text of this message

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