cjclearpool (delete connection in connection pool)
- Organization of this page
Format
- For specified data sources (JDBC)
cjclearpool [server-name] [-nameserver provider-URL] [-type jdbc] [-mode {normal|plan}] -resname data-source-display-name [-resname data-source-display-name ...]
- For specified resource adapters (deploy and use as the J2EE resource adapter)
cjclearpool [server-name] [-nameserver provider-URL] -type connector [-mode {normal|plan}] -resname resource-adapter-display-name [-resname resource-adapter-display-name ...]
- For resource adapter (include and use in the J2EE application)
cjclearpool [server-name] [-nameserver provider-URL] -type connector [-mode {normal|plan] -name application-name -resname resource-adapter-display-name [-resname resource-adapter-display-name ...]
- For all data sources (JDBC) and resource adapters
cjclearpool [server-name] [-nameserver provider-URL] [-mode {normal|plan}] -resall
Function
This command clears the connection of a specified data source (JDBC) or resource adapter. This command can delete the connections of multiple data sources (JDBC) or multiple resource adapters concurrently.
Arguments
- server-name
-
Specifies the name of the connected J2EE server. If the server name is omitted, the host name is assumed.
- -nameserver provider-URL
-
Specifies the access protocol for the CORBA Naming Service, the name of the host running the CORBA Naming Service, and the port number being used by the host. These items are specified in the following format:
protocol-name: : host-name: port-number
For details on the specification items, see 2.1.2 Provider URL.
- -type {jdbc|connector}
-
Specifies the type of connection pool. If this argument is omitted, jdbc is assumed.
-
jdbc: JDBC pool
-
connector: Resource adapter pool
-
- -mode {normal|plan}
-
Specifies the type of clear operation for the connection being used. All unused connections are cleared. If this argument is omitted, normal is assumed.
-
normal (normal mode)
A connection being used by the user is moved outside the pool and is cleared from the pool. However, the connection with the database cannot be reused.
-
plan (plan mode)
A connection being used by the user is not cleared. However, the connection cannot be reused.
-
- -name application-name
-
Specifies the name of the application that is deploying the resource adapter.
This argument can be specified when the connection pool type is connector. When this argument is omitted, the connection of any resource adapter that was deployed as a J2EE resource adapter is deleted.
- -resname data-source-display-name or resource-adapter-display-name
-
Specifies the display name of a data source (JDBC) or resource adapter that is to be cleared.
The method of specifying the resource adapter display name differs for each resource adapter version:
-
For Connector 1.0
Resource-adapter-display-name
-
For Connector 1.5
Resource-adapter-display-name!Connection-definition-identifier
-
- -resall
-
Specifies that all data sources (JDBC) and resource adapters are to be deleted.
This argument cannot be specified together with -type, -name, or -resname.
Input examples
- For a data source (JDBC) (normal mode)
cjclearpool MyServer -resname JdbcConnection
- For a resource adapter (deploy and use as a J2EE resource adapter)
cjclearpool MyServer -type connector -mode plan -resname RarConnection
- For a resource adapter (include and use in the J2EE application)
cjclearpool MyServer -type connector -mode plan -name App1 -resname RarConnection
- For all data sources (JDBC) and resource adapters (plan mode)
cjclearpool MyServer -mode plan -resall
Return values
- 0:
-
The command terminated normally.
- 1:
-
The command terminated abnormally.
- 2:
-
The command could not be executed because of an exclusion error.
- 3:
-
A timeout occurred.
- 9:
-
The command could not be executed because there are no administrator privileges (in Windows).
Notes
-
When you specify a server name in the command arguments, you must specify it immediately after the command name. You can specify the other arguments in any order as long as they are subsequent to the server name (or subsequent to the command name if the server name is omitted). However, you cannot switch the sequence of an option name and its corresponding value (for example, you cannot specify data-source-display-name -resname); also, you cannot specify an option name in conjunction with a non-corresponding value (for example, you cannot specify -nameserver data-source-display-name -resname provider-URL).
-
When you specify a server name in the command arguments, you must specify a case-sensitive character string that matches a server name specified in a cjsetup (set up or unsetup J2EE server).
-
If multiple data sources (JDBC) or resource adapters are to be deleted concurrently, this command attempts to delete all target data sources (JDBC) or resource adapters, even if there are ones that cannot be deleted.
-
In the normal mode, any in-use connections that were removed from the connection pool are not included in the connections count. Consequently, the total count of the connections in the connection pool and the in-use connections removed from the connection pool may exceed the maximum value for the connection pool.