Configuring new WAS40 connection pools using scripting

You can use scripting to configure a new WAS40 connection pool.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

Perform the following steps to configure a new WAS40 connection pool:

Procedure

  1. Identify the parent ID:
    • Using Jacl:

      set new40ds [$AdminConfig getid /Cell:mycell/Node:mynode/
      Server:server1/JDBCProvider:JDBC1/WAS40DataSource:was4DS1/]
    • Using Jython:
      new40ds = AdminConfig.getid('/Cell:mycell/Node:mynode/
      Server:server1/JDBCProvider:JDBC1/WAS40DataSource:was4DS1/')
      print new40ds
    Example output:
    was4DS1(cells/mycell/nodes/mynodes:resources.xml$WAS40DataSource_1)
  2. Get required attributes:
    • Using Jacl:

      $AdminConfig required WAS40ConnectionPool
    • Using Jython:
      print AdminConfig.required('WAS40ConnectionPool')
    Example output:
    Attribute      	Type
    minimumPoolSize     Integer
    maximumPoolSize     Integer
    connectionTimeout   Integer
    idleTimeout        Integer
    orphanTimeout       Integer
    statementCacheSize  Integer
  3. Set up required attributes:
    • Using Jacl:

      set mps [list minimumPoolSize 5]
      set minps [list minimumPoolSize 5]
      set maxps [list maximumPoolSize 30]
      set conn [list connectionTimeout 10]
      set idle [list idleTimeout 5]
      set orphan [list orphanTimeout 5]
      set scs [list statementCacheSize 5]
      set 40cpAttrs [list $minps $maxps $conn $idle $orphan $scs]
      Example output:
      {minimumPoolSize 5} {maximumPoolSize 30} 
      {connectionTimeout 10} {idleTimeout 5} 
      {orphanTimeout 5} {statementCacheSize 5}
    • Using Jython:
      minps = ['minimumPoolSize', 5]
      maxps = ['maximumPoolSize', 30]
      conn = ['connectionTimeout', 10]
      idle = ['idleTimeout', 5]
      orphan = ['orphanTimeout', 5]
      scs = ['statementCacheSize', 5]
      cpAttrs = [minps, maxps, conn, idle, orphan, scs]
      print cpAttrs
      Example output:
      [[minimumPoolSize, 5], [maximumPoolSize, 30], 
      [connectionTimeout, 10], [idleTimeout, 5],  
      [orphanTimeout, 5], [statementCacheSize, 5]]
  4. Create was40 connection pool:
    • Using Jacl:

      $AdminConfig create WAS40ConnectionPool $new40ds $40cpAttrs
      
    • Using Jython:
      print AdminConfig.create('WAS40ConnectionPool', new40ds, 40cpAttrs)
    Example output:
    (cells/mycell/nodes/mynode:resources.xml#WAS40ConnectionPool_1)
  5. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  6. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 1:23:07 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-dist&topic=txml_newwas
File name: txml_newwas.html