1

Possible Duplicate:
Why spawning threads in Java EE container is discouraged?

While reading a java specification document, came across the following statement "In this version of the specification, asynchronous communication mode is not required within a Java EE container environment. The reason is that asynchronous mode support typically requires threads, sockets and so on, which are not allowed within a Java EE component."

Can anyone explain in detail why this is discouraged?

Also, please list the other things that are also discouraged in distributed environment.

Community
  • 1
  • 1
javalearner
  • 3,314
  • 7
  • 26
  • 33
  • This question is answered already in another [SO Question why-spawning-threads-in-j2ee-container-is-discouraged](http://stackoverflow.com/questions/533783/why-spawning-threads-in-j2ee-container-is-discouraged) – momo Sep 13 '11 at 11:48
  • Thanks, Just now read that.. What are the other practices that are also discouraged? – javalearner Sep 13 '11 at 11:49
  • Always think that your code can at a blink of an eye be moved to another computer. Anything that the container does not know of, will break. – Thorbjørn Ravn Andersen Sep 13 '11 at 12:11
  • `please list the other things that are also discouraged` - this overly broad. If you want a list of things that are encouraged, those are listed in the Java EE specifications and in the related JSRs like the EJB and Servlet specifications. The Java EE authors (and anyone for that matter) would simply not have the time to come up with a list of things that are discouraged because it is difficult to think of all scenarios. – Vineet Reynolds Sep 13 '11 at 12:19

0 Answers0