Links: http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere....
Try creating a test datasource with required connection pool properties to test the script.
The script can be used to modify existing datasource or delete an existing datasource and create the same one with required values.
proc createjdbcds {cellName nodeName jdbcName jdbcDSName timeout max min reap unused aged} {
#--------------------------------------------------------------
# set up globals variables
#--------------------------------------------------------------
global AdminConfig
global AdminApp
set ds [$AdminConfig getid /Cell:$cellName/Node:$nodeName/JDBCProvider:$jdbcName/DataSource:$jdbcDSNam e/]
#set properties the connection pool
set connectionPool [$AdminConfig list ConnectionPool $ds]
set conTimeout [list connectionTimeout $timeout]
set maxConn [list maxConnections $max]
set minConn [list minConnections $min]
set reapTime [list reapTime $reap]
set unTimeout [list unusedTimeout $unused]
set agedTimeout [list agedTimeout $aged]
set purgePolicy [list purgePolicy "FailingConnectionOnly"]
set fullArgs [list $conTimeout $maxConn $minConn $reapTime $unTimeout $agedTimeout $purgePolicy]
$AdminConfig modify $connectionPool $fullArgs
$AdminConfig save
}
#-----------------------------------------------------------------
# Main
#-----------------------------------------------------------------
if {($argc 10) } {
puts "modifydsconnectionpool: this script requires at least six parameters: cellName nodeName jdbcName connectiontimeout maxcon mincon reaptime unusedtimeout agedtimeout"
puts "e.g.: modifydsconnectionpool mycell mynode SPSESS51JDBC SPSESS51DS 600 50 10 180 180 0"
} elseif {$argc == 10} {
# do some checking
set cellName [lindex $argv 0]
set nodeName [lindex $argv 1]
set jdbcName [lindex $argv 2]
set jdbcDSName [lindex $argv 3]
set timeout [lindex $argv 4]
set max [lindex $argv 5]
set min [lindex $argv 6]
set reap [lindex $argv 7]
set unused [lindex $argv 8]
set aged [lindex $argv 9]
createjdbcds $cellName $nodeName $jdbcName $jdbcDSName $timeout $max $min $reap $unused $aged
}
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.
0 comments:
Post a Comment