JSP concurrent access

Dears,

I've made some JSP, which uses session lifecycle bean. When the bean is instancing it reads a few unique values from other EIS. These values are exposed on the JSP page.

When I test it in about 10 separated threads (means 10 concurrent requests), works fine. But if I try to expand them, for instance to 50 requests, then the container responses by the wrong page entry. It happens in about 2-5% of all requests and increases during I'm going from 50 to more concurrent requests (at the same time of course).

Dou you think, that is only performance issue?

Thanks for some help

Krzysztof

[632 byte] By [kmalinowa] at [2007-11-26 19:58:19]
# 1
make sure that the session beans do not have any state (ie class level variables) because the EJB container will reuse the beans as load increases without re-initializing them
tolmanka at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Oh, I didn't use EJB any bean, I used JSP bean for that.Krzysztof
kmalinowa at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
"I've made some JSP, which uses session lifecycle bean."Sorry. I read the above to mean that you were using EJB Session Beans.
tolmanka at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

This is unlikely a performance issue.

Returning wrong entries between multiple requests is a clear indication of thread safety violation.

Do a quick check to see if you've declared any variables in your JSP declaration <%! %> section. If there are, you have to move those variables inside the scriptlet <% %> section.

singchyuna at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Please, have a look

I initialize the JSP bean like below:

<jsp:useBean id="user" class="komtel.bean.User" scope="session">

<jsp:setProperty name="user" property="login" value="<%= request.getParameter(\"login\") %>"/>

</jsp:useBean>

I don't declare any variable, then after few lines below I get some properties o that bean:

<span style="position:absolute; left:20px">User: <jsp:getProperty name="user" property="firstName" /> <jsp:getProperty name="user" property="lastName" /></span>

kmalinowa at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Actually it isn't JSP problem!

I made some tests which analized step by step processing way.

It's only proble with external EIS, doesn't get correct answer to JSP when it works under high stress.

In this case I resolved this problem by preparing more efficient communication channel between JSP application and EIS.

Thanks for discussion!

kmalinowa at 2007-7-9 22:53:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...