If the data is truly once only for the entire application, I'd write a singleton and have the applications each access that. You can control race conditions to start by synchronizing the methods of the singleton and later optimize the performance by removing the synchronization there and instead synchronizing inside each method on exactly the subset of data being altered. This would get you running quickly and still lend itself to further optimizations later. If you put it in the context, you still have to solve the race condition issues or end up with possibly corrupt data.
--- Merrill Cornish <[EMAIL PROTECTED]> wrote: > I think I know the answer to this, but I would like reassurance. > > I'm building a timesheet application using JSP, servlets, and Tomcat. > So far, I been very careful to keep all non-contant data out of > servlet class instance variables so everything should be thread safe > and there should be no interference between simultaneous users of the > application. > > Now, I've got some information I WOULD like to share across all > sessions of the application (but not across other Tomcat > applications). So, that should mean that all I really have to do is > defined the information in instance variables (and remember when > using it that it can change unexpectedly). Right? > > Merrill > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
