• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session error spillover

 
Chad Clites
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an app that allows users to enter financial data, and then balances are generated on the fly. Each user has their own sessions, and their own private accounts. Every once in awhile a user will be funny and do things like spelling the date which causes an error because the app is expecting a number (which I have since fixed... never underestimate the creativeness of your users).

Anyway, once the error is generated, it throws it for all users, and effectively locks up the system for everybody. Is that a Tomcat issue, or a java issue? It makes sense to me that if an error is thrown in one session, it shouldn't be able to affect other users..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is almost certainly an issue with your own application code. How exactly are you handling the error?
 
Chad Clites
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it was probably my code, but I couldn't see how it was propagating the error across all users.I wasn't catching an error at all because I thought I had all potential inputs covered.

If I am taking your question correctly, the method that reads my input should be catching the errors?

EDIT: To clarify, when it did detect input that didn't pass the checks I had put in place, an error page displayed. If the input made it past those checks due to my lack of foresight, there was nothing to catch it.
[ May 16, 2006: Message edited by: Chad Clites ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an input error on one user's part is causing errors in other user's sessions, there is a good chance that your apps structure has some serious flaws.

Are you relying on instance variables, singletons, or context scoped objects in your app? If so, can you describe how you're using them?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds almost like a static variable in a JSP is being set by one instance causing all instances to see it when next they're called.
 
Chad Clites
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code that is causing the error:

I'm not sure if this is enough code, but this is the part that is causing the error; specifically when parsing the string to an int. This snippet is to check if a date falls within a specific range, and if it does, tick a counter
[ May 16, 2006: Message edited by: Chad Clites ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


How are you creating and where are you storing the ledger variable?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also the old and counter variables; how are they being declared and stored?
 
Chad Clites
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ledger is declared globally: ArrayList ledger = new ArrayList();
counter is declared right before the loop (locally): int counter = 0;
old is global also. I can't think right now why I did it that way, because it really only needs to be local.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic