Progressbar example and starting new Thread

Hi,

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.
Richard

Use a thread pool, either one with a single thread or multiple depending on what you need.
http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html

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.

Richard