Progressbar example and starting new Thread


I’ve implemented the Progressbar example as described in the book of vaadin (7.1). But i have learned that starting your own threads in a servlet container (in our case Websphere) is evil. This way the thread is not managed by the container which can lead to threads hanging around and potential out of memory errors.

Can someone please comment on my statement about starting your own threads and tell me if there are any alternative solutions.

Thank you.

Use a thread pool, either one with a single thread or multiple depending on what you need.

Thank you for your response.

However creating or using your own ThreadPool is not at hand here.
WebSphere manages it’s own threads (on so it should be) so creating your own threads is not the proper way since they are not managed by WebSphere.

I’ve found a more elegant way and that is the @EJB and @Aynschronous annotation. It basically does the same however the threads created are managed by WebSphere.