WAS v8.5 > Script the application serving environment (wsadmin) > Scripting for data access resources > Configure data access with wsadmin scripting

Configure new WAS40 connection pools using wsadmin.sh

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

Before starting this task, wsadmin must be running. See the topic on starting wsadmin for more information. Configure a new WAS40 connection pool:

  1. Identify the parent ID:

    • Jacl:

      set new40ds [$AdminConfig getid /Cell:mycell/Node:mynode/
      Server:server1/JDBCProvider:JDBC1/WAS40DataSource:was4DS1/]
    • 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:

    • Jacl:

        $AdminConfig required WAS40ConnectionPool
    • 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:

    • 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}
    • 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:

    • Jacl:

        $AdminConfig create WAS40ConnectionPool $new40ds $40cpAttrs
    • Jython:

        print AdminConfig.create('WAS40ConnectionPool', new40ds, 40cpAttrs)

    Example output:

      (cells/mycell/nodes/mynode:resources.xml#WAS40ConnectionPool_1)

  5. Save the configuration changes.


Related


Start the wsadmin scripting client using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration
Save configuration changes with wsadmin


Reference:

Commands for the AdminConfig object using wsadmin.sh


+

Search Tips   |   Advanced Search