• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session error spillover

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How are you creating and where are you storing the ledger variable?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic