Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pool in cluster environment

 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The underline connection object is a socket connecting two IP addresses. Cluster is a collection of two or more app servers. Let's assume each app server is deployed to a different computer. How does connection pool in cluster environment work?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34371
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vu,
Each app server instance (physical cluster) has it's own connection pool. The app servers on the same cluster share a connection pool.
 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
Could you please elaborate on this?
Each app server instance (physical cluster) has it's own connection pool. The app servers on the same cluster share a connection pool.


What is a physical cluster? Does it have its own IP address? Who create the connection pool? is it the cluster or the app server? Does it mean the same connection can be shared by multiple app servers? Thanks in advance.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot of stuff relating to clustering is specific to a particular container. For WebLogic, when a server-side client obtains a JDBC Connection via a JNDI lookup and a DataSource, a local object is returned by the DataSource from the Connection pool it references (rather than going to another cluster member for its JDBC connections). The Connection is pinned to the local server instance for the duration of the database transaction, and as long as the application code retains it (until the Connection is closed).

So, clustering the Connections does not enable failover of Connections but it can ease the process of reconnection when a Connection fails.
 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still confused. I'll google to learn more about this. In a mean while it would be great if some one could throw more light on this issue.

It is better to cache preparedStatement from a cluster connection pool than local app server. What is the relationship between a cluster connection pool and a local app server connection pool?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic