users@glassfish.java.net

Glassfish v3 Prelude does not seem to run same Servlet concurrently

From: <glassfish_at_javadesktop.org>
Date: Sun, 03 May 2009 11:14:41 PDT

Hi,
I have tested Glassfish v3 Prelude(build b28c) by putting a Thread.sleep in the servlet code:
   System.err.println("In servlet 1");
   Thread.sleep(5000);
   System.err.println("Done 1");

When I open two windows at the same time, requesting the same Servlet, the second window takes 10 secs and the server log shows:
SEVERE: In servlet 1
SEVERE: Done 1
SEVERE: In servlet 2
SEVERE: Done 2

When I try with two different Servlets, this does not happen. The log shows:
SEVERE: In servlet 1
SEVERE: In servlet 2
SEVERE: Done 1
SEVERE: Done 2

AFAIK there is no requirement in Servlet spec to serialize requests to the same Servlet (unless marked with SingleThreadModel). This seems wrong since serializing requests will degrade performance.

Am I missing something ?

Thanks,
Ozgur
[Message sent by forum member 'ooktay' (ooktay)]

http://forums.java.net/jive/thread.jspa?messageID=344779