> -----Original Message----- > From: Joe Hertz [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 24, 2004 9:49 AM > To: 'Struts Users Mailing List' > Subject: RE: I suspect this is a bad idea...so what's a better one? > > > > You are not safe here ... there is one and only one instance of each > > Action, shared by all requests through the lifetime of the web > > application. > > I'm picking this topic up again and actually, what I'm > kicking myself for > just now occuring to me is this: > > To recap: if I make my Persistence object a protected class > level variable > inside of an Action subclass, it's not going to be threadsafe... > > But... > > If that class has only static public methods, and a static > ThreadLocal class > variable for it's connection to the database, et al, then it > should be safe > anyway. > > Yeah, I'll have a type conversion for the ThreadLocal in each database > method, but not in every blessed action method. > > One last sanity check? :-)
It seems like you're over engineering something that is simple... what problem are you trying to solve with this? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]