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 -> OWAS3.0, Java cartridge and Sessions

OWAS3.0, Java cartridge and Sessions

From: Rob Groves <rob.groves_at_btinternet.com>
Date: Fri, 13 Aug 1999 20:42:54 GMT
Message-ID: <37b47e05.888401@news.btinternet.com>


All,

I am having trouble understanding the way sessions work with the Java cartridge on Oracle web server 3.0.1.1.0.

I have sessions enabled on the cartridge admin page (and this is reflected in the wrb.app file) timeout set to 300. I quote from the WAS_FAQ I go from www.oracle.com:

Q: If I have a session-enabled cartridge, does it service requests from more than one client simultaneously, or is it dedicated to a single client at a time?

  1. It is dedicated to a single client at a time. After the session times out, it is returned to the pool .

This is NOT the bahaviour I have witnessed. I have tried the following types of different clients simultaneously:

  1. Another browser window on the same machine
  2. Another instance of the browser on the same machine
  3. Another make of browser on the same machine
  4. Another browser on a different machine

All are connecting to the same cartridge instance. The timeout works OK, but different clients are not being directed to different instances of the cartridge. I know this from two observations:

  1. static data members are available to all clients.
  2. Object set with WRB.setCLientContext() is available to othe rclients with WRB.getClientContext().

From this I deduce that either the FAQ is wrong, or I have things configured wrongly.

Has anybody else got to the bottom of this? ARe there any online docs? the ones I have read from Oracle seem to skate over the issue of sessions.

Thanks,

Rob.

Example code follows:

import oracle.html.*;
import java.util.*;
import java.io.*;
import oracle.owas.wrb.WRB;

public class aTest
{

        public static int calls = 0;

	public static void main(String args[])
	{
		calls++;
		HtmlStream out = HtmlStream.theStream();

		out.println("Content-type: text/html");
		out.println("<HTML><HEAD>HEADER</HEAD><P>");
		out.println("<BODY>BODY</BODY>");
		out.println("<P>Calls so far: " +

Integer.toString(calls) + "<P>");
		String strContext = (String)WRB.getClientContext();
		if (strContext == null)

{
out.println("Context is null<P>"); String str = new String("This is the context string"); WRB.setClientContext(str); } else
{
out.println("Context is not null: " + strContext + "<P>"); } out.println("</HTML>"); }

} Received on Fri Aug 13 1999 - 15:42:54 CDT

Original text of this message

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