Syntax for pcmsessions

The pcmsessions command is a command line utility and must be executed at a system prompt. The syntax is:

OSCommand
Windowspcmsessions –dbase dbname@ODBC_DSN
Linuxpcmsessions –dbase dbname@SID

You can use one or of the optional switches (see table) in combination to filter the display or when clearing sessions.

When you use the pcmsessions command to clear sessions, only do so for defunct sessions. Clearing active sessions results in a loss of work—when an active session (lock) is cleared, work done during the session is lost.

An active session is one created for a user who:

  • is currently attached to the database and is using a Contenta application; these are short term sessions (such as EDIT). To display short term sessions use the -short switch.
  • has checked-out an object and is making modifications offline; these are long term session (such as CHECK OUT) To display long term sessions use the -long switch.

Note that there is only one switch that clears the sessions (locks), it is the -clear switch. All other switches are for displaying information about locks. When using the clear switch, make certain that you understand the consequences of clearing active sessions.
SwitchesDescription

Windows:

dbname@ODBC_DSN

—or—

Linux:

dbname@SID

Required: dbname.

The name of the existing Contenta database.

Optional: ODBC_DSN (Windows)

The ODBC data source name. If not specified, the default is used—as defined in the registry for XYV_PDM_ODBC_DSN

Optional: SID (Linux)

The system identifier. If not specified, the default is used—as defined in the registry for XYV_PDM_DATABASE_SID

-all

Displays all sessions.

When used with the -clear switch, note that all sessions (locks) are cleared.

-app appname
Displays sessions started by the application specified by the appname.
-checkout

Displays CHECKOUT sessions only.

Checkout sessions are stored in the users table. A Checkout session lock is maintained beyond the life of a process; this is done so that the Checkin process can import the data at a future date. Checkout sessions can be observed even when there are no users attached to the database.

-clear

Clears EDIT sessions (locks) only.

You can use this switch with other switches to clear specific locks, or all locks (when used with the -all switch).

-edit

Displays EDIT sessions only.

An EDIT session is created when a process attaches to the database; it is removed when the process disconnects from the database.

Does not list checkout sessions.

EDIT is the default.

-host hostname

Displays sessions started by the host specified by hostname; hostname is the database server name.

-lockid lockid

Displays sessions specified by lockid—where lockid is a lock ID other than the one having the same parent process ID, user name, and last name as the invoking process.

Specify the lockid as the Session Id number shown in the pcmsessions output.

-long

Displays long term sessions only.

Lists long term CHECKOUT sessions. In the example below, use of this switch would result in a list containing only the sessions of Type CHECKOUT.

-short

Displays short term sessions only.

Lists short term EDIT sessions. In the example below, use of this switch would result in a list containing only the sessions of Type EDIT.

-user username

Displays sessions started by the user specified by username

-pid process_id

Linux only.

Can use to specify the process id. For example, you can specify to clear a session specifying its pid.

Example Output from the pcmsessions command

The table below contains a description of the pcmsessions output.

FieldDescription
Session IdA unique id that is assigned to a session by Contenta.
Parent Session

Identifies active CHECKOUT sessions.

It contains the session id of the process which is actively controlling a checkout lock.

It is always zero for EDIT sessions.

ApplicationThe name of the application that attached to the database.
User

The name of the Contenta Explorer user (desktop) who started the session.

Host

The host name of the system on which the process is running.

Type

EDIT—active user session; session is currently attached to the database.

CHECKOUT—ignored by applications that require exclusive access to the Contenta database.

SINGLEUSER—used by applications such as the Contenta Administration Tool to claim exclusive access to the Contenta database.

Started

The date and time in 24 hour format that the session was started.