$Session Close: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 5: | Line 5: | ||
<var>$Session_Close</var> closes an open [[Sessions|session]], accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one. | <var>$Session_Close</var> closes an open [[Sessions|session]], accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one. | ||
==Syntax== | |||
<p class="syntax"><section begin="syntax" />%rc = $Session_Close(sesid, owner, timeout) | |||
<section end="syntax" /></p> | |||
===Syntax terms=== | |||
<p>%RC is set to 0 or to an error indicator.</p> | |||
The first argument is new id to be given to the session being closed. This is an optional argument and if not specified leaves the session's id unchanged. | The first argument is new id to be given to the session being closed. This is an optional argument and if not specified leaves the session's id unchanged. | ||
Line 12: | Line 19: | ||
The third argument is the new value to be used as the session timeout value, that is the time after which the session is considered '''timed-out''', that is eligible for deletion. A value of -1 means to use the SRSDEFTO parameter value. This is an optional argument and if not specified leaves the session's timeout value unchanged. | The third argument is the new value to be used as the session timeout value, that is the time after which the session is considered '''timed-out''', that is eligible for deletion. A value of -1 means to use the SRSDEFTO parameter value. This is an optional argument and if not specified leaves the session's timeout value unchanged. | ||
== | ===$Session_Close return codes=== | ||
<p class="code"> | <p class="code"> | ||
-1 - Session not open | -1 - Session not open | ||
Line 25: | Line 27: | ||
3 - User session limit exceeded | 3 - User session limit exceeded | ||
</p> | </p> | ||
The return codes greater than 0 can only happen when one or more of the session attributes (id, owner, timeout) is being changed. | The return codes greater than 0 can only happen when one or more of the session attributes (id, owner, timeout) is being changed. | ||
After a <var>$Session_Close</var>, any session $lists, longstrings and XMLDocs will no longer be accessible | ==Usage notes== | ||
<ul> | |||
<li>After a <var>$Session_Close</var>, any session $lists, longstrings and XMLDocs will no longer be accessible. | |||
<li>If a <var>$Session_Delete</var> had been done for the session before it was closed by the user who had the session open or someone else, the session is immediately deleted when the <var>$Session_Close</var> is done. A logout always does an implied <var>$Session_Close</var> so <var>$Session_Close</var> is only necessary if another session is to be open or to minimize the time window in which the session might be requested by another thread. | |||
==Example== | |||
The following example closes the current session, making it a public session in the process: | The following example closes the current session, making it a public session in the process: | ||
<p class="code"> % | <p class="code">%rc = $Session_Close(, '*') | ||
</p> | </p> | ||
Line 48: | Line 51: | ||
<li>[[Japanese functions]]</li> | <li>[[Japanese functions]]</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$Session_Close]] | [[Category:$Functions|$Session_Close]] |
Revision as of 20:54, 19 November 2012
Close an open session
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Session_Close function is to be entered.
$Session_Close closes an open session, accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one.
Syntax
<section begin="syntax" />%rc = $Session_Close(sesid, owner, timeout) <section end="syntax" />
Syntax terms
%RC is set to 0 or to an error indicator.
The first argument is new id to be given to the session being closed. This is an optional argument and if not specified leaves the session's id unchanged.
The second argument is the userid that is to be set as the new owner of the session being closed. An owner of "*" means that the session is public, that is available to all users. Only a system administrator can create a non-public session for a user other than itself. This is an optional argument and if not specified leaves the session's owner unchanged.
The third argument is the new value to be used as the session timeout value, that is the time after which the session is considered timed-out, that is eligible for deletion. A value of -1 means to use the SRSDEFTO parameter value. This is an optional argument and if not specified leaves the session's timeout value unchanged.
$Session_Close return codes
-1 - Session not open 0 - No errors 1 - Session id already exists for user 2 - Online session limit exceeded 3 - User session limit exceeded
The return codes greater than 0 can only happen when one or more of the session attributes (id, owner, timeout) is being changed.
Usage notes
- After a $Session_Close, any session $lists, longstrings and XMLDocs will no longer be accessible.
- If a $Session_Delete had been done for the session before it was closed by the user who had the session open or someone else, the session is immediately deleted when the $Session_Close is done. A logout always does an implied $Session_Close so $Session_Close is only necessary if another session is to be open or to minimize the time window in which the session might be requested by another thread.
Example
The following example closes the current session, making it a public session in the process:
%rc = $Session_Close(, '*')
Products authorizing $Session_Close