Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Losing object reference in sessions

 
Heather Danielson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a bean (OrderValues) on the session that contains many vectors to store information from an HTML form. If I have only one session running, all of my data is retrieved correctly, however, when I'm running multiple sessions( i.e. multiple browser instances) all of my session data is retrieved correctly except from one vector that is storing object references. The object references returned are those that belonged to the last session to hit the web server (Tomcat 4.0.3). Any ideas on what I can do to correct this problem?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One would immediately suspect that there is only one instance of the Vector in question in the entire application. Where does it get created?
Bill
 
Heather Danielson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a new session I call a servlet that creates a new OrderValues bean ( this bean contains all the Vectors). The constructor for the OrderValues bean sets each of the Vectors to "new Vector();". This bean is then placed on the session Object. I have double checked my code to be sure that the Vector in question ( subscriberInfo) is in fact being set to a "new Vector();".
The subscriberInfo Vector stores objects of type Subscriber, and I have the Subscriber objects on the session Object as well.
I'm obviously doing something incorrectly, but I can't find it yet. Any help is much appreciated!
 
Heather Danielson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alas, I have found my coding error: I instantiated the subscriberInfo Vector as a static variable. Must've been a brain fart! Thanks for all your help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic