Ilhan,
What is occurring is sometimes called a "concurrency" problem. Bottom line,
you did not design your JSP/classes/beans to be multi-user (which in turn
requires some class/beans to be multi-threaded and synchronized).
I gather that you want the logon_id to be some type of counter, where as
each person who logs on receives his/her own logon_id based on the order
they hit your sever during the day. Consider creating a singleton class
bean to encapsulate your login-id parameter, instead of using the parameter
directly in your JSP. This way, only one copy of your class can exist at
any time. Within your singleton class, declare your logon_id parameter as
static. Then you will need to implement methods to increment the counter,
pass it up to the JSP, and return the counter's value back when that user
has logged off. I am assuming that you will want to recycle your counter at
some point back to 0, otherwise if you have 1000 users in a 24 hour period,
the value of login_id would become excessively large in a short period of
time.
If you want to limit the number of people who are actively using your web
site to a "top end" value, say 1000, then you will want to consider creating
some type of logon pool, where as you return the logon_id back to the pool
for reuse by a waiting user. Since most JDBC drivers contain connection
pools, if this is your intent, you would probably want to use the connection
pool as your limiting factor in how many user's can be "connected" to your
db at one time, instead of a logon counter. This is a more "graceful" way
of limiting how many people can be connected to your db, instead of limiting
the number of users hitting your web site at any one time.
Celeste
-----Original Message-----
From: ILHAN DOGAN [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 13, 2001 3:06 AM
To: [EMAIL PROTECTED]
Subject: JSP Session Trouble
Hi all ;
I have a sessioning problem with JSP :
In logon.jsp I defined a bean like :
<jsp:useBean id="logon_id" class="oracle.jsp.jml.JmlString" scope="session"
>
<jsp:setProperty name="logon_id" property="value" param="logon_id" />
</jsp:useBean>
and set logon_id value as session value.
In other .jsp pages we redefine logon_id same as above and use its value
which is set at logon page.
This method works well when running all jsp files with signle user.
Our problem arises when I deploy the project to ApacheJserv and call the
logon.jsp from diffrent clients
The logon_id's value is set to "1" when first user launches logon.jsp
and all other .jsp files uses this value until
second user runs logon.jsp and sets logon_id to "2" . then in both
users all .jsp 's get logon_id as "2".
Our problem is either we are making a serious mistake in defining session
values or there is a trouble in ApacleJServs configuration.
So Could you please send us a samle code or documentation which clarifies
defining usage of session and application variables .
Thanks for your attention
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets