D
David McDivitt
Thanks Virgil. Your criticism of three active shared connections as I
propose represents a pooling approach. The three shared connections are not
pooled, but shared. Round robin is used for load balancing between them. If
the collection of connections grows and shrinks dynamically as you propose,
then literally these are being created and destroyed based on need and there
is no advantage whatsoever to having anything pooled. The concept of pooling
implies connections are not destroyed, meaning no close or logoff ever
happens at the server for them, and new requests get a hot connection. The
idea of pooling is a waste of time. What's needed is connection sharing. If
trans blocks are needed a standalone connection should be obtained instead.
Yes, these are struts applications. The classes used are all user written,
or, pasted from something else and changed a bit. They are:
DataSourcePlugIn
Padbmt00DBConnectionManager
BaseDAO
PersistenceMap
PersistenceMapDAO
PersistenceMapFactory
getPooledConnection is in the BaseDAO class and has the following:
try {
db = Padbmt00DBConnectionManager.getInstance();
Connection conn = db.getConnection();
String query = "SELECT '1' FROM SYSIBM.SYSDUMMY1";
Statement statement1 = conn.createStatement();
ResultSet rs1 = statement1.executeQuery(query);
rs1.close();
statement1.close();
return conn;
}
catch (com.ibm.ejs.cm.portability.StaleConnectionException e) {
try {
Connection conn =
Padbmt00DBConnectionManager.getInstance().getConnection();
return conn;
catch(Exception ee){
ee.printStackTrace();
return null;
}
}
catch (Exception e) {
e.printStackTrace();
return null;}
}
The driver name COM.ibm.db2.jdbc.app.DB2Driver can be found in
datasource.xml.
One high priority project has 12 developers working as needed. Things are so
convoluted, people have recently been instantiating their own driver and
connection and bypassing the connection management.
propose represents a pooling approach. The three shared connections are not
pooled, but shared. Round robin is used for load balancing between them. If
the collection of connections grows and shrinks dynamically as you propose,
then literally these are being created and destroyed based on need and there
is no advantage whatsoever to having anything pooled. The concept of pooling
implies connections are not destroyed, meaning no close or logoff ever
happens at the server for them, and new requests get a hot connection. The
idea of pooling is a waste of time. What's needed is connection sharing. If
trans blocks are needed a standalone connection should be obtained instead.
Yes, these are struts applications. The classes used are all user written,
or, pasted from something else and changed a bit. They are:
DataSourcePlugIn
Padbmt00DBConnectionManager
BaseDAO
PersistenceMap
PersistenceMapDAO
PersistenceMapFactory
getPooledConnection is in the BaseDAO class and has the following:
try {
db = Padbmt00DBConnectionManager.getInstance();
Connection conn = db.getConnection();
String query = "SELECT '1' FROM SYSIBM.SYSDUMMY1";
Statement statement1 = conn.createStatement();
ResultSet rs1 = statement1.executeQuery(query);
rs1.close();
statement1.close();
return conn;
}
catch (com.ibm.ejs.cm.portability.StaleConnectionException e) {
try {
Connection conn =
Padbmt00DBConnectionManager.getInstance().getConnection();
return conn;
catch(Exception ee){
ee.printStackTrace();
return null;
}
}
catch (Exception e) {
e.printStackTrace();
return null;}
}
The driver name COM.ibm.db2.jdbc.app.DB2Driver can be found in
datasource.xml.
One high priority project has 12 developers working as needed. Things are so
convoluted, people have recently been instantiating their own driver and
connection and bypassing the connection management.