| Author |
How many instances of the JVM exist in a collocated application?
|
Benjamin Weaver
Ranch Hand
Joined: Apr 08, 2003
Posts: 161
|
|
I am new to EJB and have the following question: If I deploy a web-based application on a EJB 2.0-enabled J2EE server, and this application consists of 1 servlet, 3 JSPs, 2 session and 2 entity EJBs communicating in a COLLOCATED application via local (not remote) interfaces, How many instances of the JVM are running? My guess is 1. Is this correct?
|
 |
vikasids sharma
Ranch Hand
Joined: Aug 01, 2003
Posts: 157
|
|
well Weaver 1. Point of view i say when u are using local interfaces instead of remote interfaces, it means there is no inter JVM interactions rather they are intra JVM interactions .So single instance of JVM is running. 2. poit of view say we have two JVMs running on m/c.Our client code implements JVM 1 and sever side components implement JVM 2 .Then we can say two instances of JVM are running. please do comment .i may be wrong...
Originally posted by Benjamin Weaver: If I deploy a web-based application on a EJB 2.0-enabled J2EE server, and this application consists of 1 servlet, 3 JSPs, 2 session and 2 entity EJBs communicating in a COLLOCATED application via local (not remote) interfaces, How many instances of the JVM are running? My guess is 1. Is this correct?
|
Thanks
Vikas Sharma
SCJP(1.4)
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
The use of local interfaces pretty much requires everything to run in a single JVM. Other than that, it's up to the application server vendor to decide how many JVMs they want to launch for running the containers.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
vikasids sharma
Ranch Hand
Joined: Aug 01, 2003
Posts: 157
|
|
So we must conclude by "Cannot judge how manny number of instances are running ,all depends upon vendor specfic implementation" right?
Originally posted by Lasse Koskela: The use of local interfaces pretty much requires everything to run in a single JVM. Other than that, it's up to the application server vendor to decide how many JVMs they want to launch for running the containers.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
Yes, I would say so. Here's a quote from the J2EE specification:
This specification doesn�t require that a J2EE product be implemented by a single program, a single server, or even a single machine. In general, this specification doesn�t describe the partitioning of services or functions between machines, servers, or processes. As long as the requirements in this specification are met, J2EE Product Providers can partition the functionality however they see fit. A J2EE product must be able to deploy application components that execute with the semantics described by this specification. A very simple J2EE product might be provided as a single Java virtual machine that supports applets, web components, and enterprise beans in one container (although this would be an extreme, and probably rare, case), and application clients each in their own container. A typical low end J2EE product will support applets in one of the popular browsers, application clients each in their own Java virtual machine, and will provide a single server that supports both web components and enterprise beans. A high end J2EE product might split the server components into multiple servers, each of which can be distributed and load-balanced across a collection of machines. This specification does not prescribe or preclude any of these configurations. A wide variety of J2EE product configurations and implementations, all of which meet the requirements of this specification, are possible. A portable J2EE application will function correctly when successfully deployed in any of these products.
|
 |
 |
|
|
subject: How many instances of the JVM exist in a collocated application?
|
|
|