Anayonkar Shivalkar wrote:Hi Sajal,
Welcome to CodeRanch!
The concept is not very difficult to understand: Whenever you start an application with 'java' command (directly or indirectly), then you are starting a JVM.
e.g. you write a simple 'addition' program and if you run it 5 times - it will spawn 5 different processes, and each process is a JVM.
A cluster is set of application server processes. A cluster can be created on single host (which is not preferred) or multiple host (which is preferred).
Coming to server - I'm not clear what do you mean by 'server' - is it physical host, or application server? An application server works with single JVM.
Now, since you can have different configuration for different JVMs, it is logical to execute applications (mostly JSE) across different JVMs.
1 Cluster: 1 or more application server
1 Application server: 1 JVM
1 Java instance: 1 JVM
You can have multiple applications on single application server - in which case, all those apps would run in single JVM instance (and we have to be careful while dealing with singleton objects etc.)
I hope this helps.
Jeanne Boyarsky wrote:That is correct. Connection pooling is for reuse. There are two types of pools. The most common one is a datasource on the application server. For example, Oracle provides a connection pooling datasource for use in WebLogic, WebSphere, etc. The other common one is an open source connection pooling library. A connection pool wouldn't be on the database server because you are trying to reuse connections TO the database server.
I'm not sure what you mean about the factory pattern. The library takes care of this. It tracks the status of each connection. Is it in use? Has it been returned to the pool?