We can beat the horse. ;) I use ThreadLocals for most conversation  
scope objects, request, entitymanager, etc. You sorta have to because  
JEE, well, sort sucks. If you are calling these user data, then yeah,  
it could happen, but just clean up after yourself. You should probably  
be fully capable of handling conversation boundaries inside and  
outside JEE. I wouldn't put much of anything else in there though.

So, I'm not convinced that leaking user data just happens and that is  
this major issue you are making it out to be. I consider a JVM crash  
from an OOM error the worse that can happen because it is often fatal.

On most platforms the threads limits are control by memory, files  
descriptors, the kernel, etc. The VM will crash and not recover for a  
number of reasons and OOM is one of them. OOM errors can occur for  
other reasons besides the inability to create a thread, which on some  
platforms happens *way* below 15K. But, if your app is crashing from  
thread creation issues, you got serious architecture problems.

All that being said, if you create a TL scope and misuse it, you got  
issues. If you setup a cache and misuse it, you got issues. Which is  
worse, I say OOM over TL almost all the time.

-bp


On Oct 2, 2008, at 5:57 PM, Dhanji R. Prasanna wrote:

>
> To beat a dead horse: leaking user data is a security problem and is  
> *much* worse than running OOM and crashing (which is unlikely given  
> that JVMs have a limit of 15K threads, even if you assume 1 instance  
> leak per TL).
>
> Dhanji.
>
> On Fri, Oct 3, 2008 at 9:30 AM, Brian Pontarelli  
> <[EMAIL PROTECTED]> wrote:
>
> > Yea but it's a scoping leak which is far worse =D
>
> Definitely really nasty, but worse.... that's debatable. VMs don't
> like OutOfMemoryErrors much. All those other application errors, they
> don't mind so much. ;)
>
> -bp
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to