S/Web Objects

 

Home S/Web Description S/Web Overview S/Web Installation S/Web Features S/Web Functions S/Web Objects S/Web Settings S/Web Troubleshoot S/Web FAQ S/Web Appendices

Cache Client Document LH Repository Request Response Server Session

Links on this page:
 

Properties

Methods

LH Object

This object handles information relating to Linear Hash files

Properties:

Property Get/Set Description
CACHEHANDLESGet/SetSets or retrieves flag indicating whether LH Table handles are cached.
LOCKTYPEGet/SetSets or retrieves flag indicating the LH lock type. 0 for optimistic, 1 for pessimistic (web only) and 2 for pessimistic (real time - web and local)
LOCKTIMEGet/SetSets or retrieves the time that indicates when a held lock times out.
UNLOCKQTIMEOUTGet/SetSets or retrieves the amount of time to wait for another server to unlock the attempted record.
XVERSIONGetContains the current S/Web version

Methods:

call www_Exec_Method( "LH", method, param1, param2, param3, param4, param5 )

Method Description 
CREATEInstantiate the current LH object, the constructor method.
DELETEUsed to delete a row or record from an LH table or file.
DESTROYThis method has not yet been implemented.
GETUsed to get properties of the current LH object
LOCKUsed to lock an LH row or record
OPENUsed to open an LH table or file.
PURGEClears out all the locking data from the WWW_LH table and the current object.
READUsed to read a row or record from an LH Table or file
READCACHEUsed to read a record that exists in the cache. This is similar to the R/BASIC or Basic+ READO statement.
SETUsed to set properties of the current LH object
UNLOCKUsed to unlock an LH row or record
UNLOCKQCalled by the server to released expired lock records. This is only used with shared Pessimistic locking
WRITEUsed to write a row or record to an LH table or file

CREATE method

This method should not be called by the end user!

ArgumentDescription 
param1  Not used.
param2  Not used.
param3  Not used.
param4  Not used. 
param5  Not used. 

DELETE method

This method deletes a row or record from an LH table or file.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records.
param3  Polymorphic flag whose meaning depends on the type of locking in use.
If the locktype is OPTIMISTIC then this value is Not used
If the lock type is PESSIMISTIC then a TRUE$ will force a delete even if the client doesn't have the lock.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "SWEB_TEST_TABLE1"
TableNames   :=  @RM : "SWEB_TEST_TABLE1"

RowIDs       =   "DELETEME1"
RowIDs       :=  "DELETEME2"

if www_Exec_Method( "LH", "DELETE", TableNames, RowIDS, "", "", "", errorText ) then
   * The specified information has been deleted
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

DESTROY method

This method has not yet been implemented

Argument Description 
param1  Not Used
param2  Not used.
param3  Not used.
param4  Not used. 
param5  Not used. 

GET method

This method retrieves properties for the LH object.

Argument Description 
param1  The name of the property we wish to retrieve. This value can be @RM delimited to hold multiple properties
param2  Returns value of requested properties. This value will be @RM delimited to match param1
param3  Not used.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

Properties   =   "LOCKTYPE"

if www_Exec_Method( "LH", "GET", Properties, ReturnValues, "", "", "", errorText ) then
   * The specified information has been retrieved
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

LOCK method

This method locks a row(s) or record from an LH table or file.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records.
param3  Returns true$ if locks successful.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "SWEB_TEST_TABLE1"
TableNames   :=  @RM : "SWEB_TEST_TABLE1"

RowIDs       =   "LOCKME1"
RowIDs       :=  "LOCKME2"

if www_Exec_Method( "LH", "LOCK", TableNames, RowIDS, Result, "", "", errorText ) then
   * The specified information has been locked
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

OPEN method

This method opens an LH table or file to a file variable.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  File variables returned.
param3  TRUE$ if file handle should be cached to speed up subsequent access.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "SWEB_TEST_TABLE1"
TableNames   :=  @RM : "SWEB_TEST_TABLE2"

CacheState = False$


if www_Exec_Method( "LH", "OPEN", TableNames, hTableNames, CacheState, "", "", errorText ) then
   * The specified tables have been opened
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

PURGE method

This method deletes a row or record from an LH table or file.

Argument Description 
param1  True$ if the locking table is to be purged, false if only the in memory locking flags are to be purged.
param2  Not used. 
param3  Not used. 
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

ClearTableFlag = True$

if www_Exec_Method( "LH", "PURGE", ClearTableFlag, "", "", "", "", errorText ) then
   * All lock information has been removed
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

READ method

This method deletes a row or record from an LH table or file.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records.
param3  Rows read returned in an @Rm delimited list. If Param4 is blank then complete rows will be returned.
param4  List of columns to read per row. An @Fm delimited list per @Rm delimited table. If null then all of the row(s) are returned.
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "PARENT_TABLE"
TableNames   :=  @RM : "CHILD_TABLE"

RowIDs       =   "ROW1"
RowIDs       :=  @Rm : "ROW2"

Columns      =   ""
Columns      :=  @Rm : 1 : @Fm : 2 : @Fm : "FULLNAME"

if www_Exec_Method( "LH", "READ", TableNames, RowIDS, Rows, Columns, "", errorText ) then
   * The specified information has been deleted
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

READCACHE method

See READ method. Only difference is that READCACHE reads from the cache file - meaning the record as the current user read from disk on the initial read. Allows developer to ascertain whether row has changed since originally read from disk by issuing a read then a readcache.

SET method

This method sets a property of the LH object.

Argument Description 
param1  The name of the property we wish to retrieve. This value can be @RM delimited to hold multiple properties
param2  New values of requested properties. This value will be @RM delimited to match param1
param3  Returns old values of requested properties.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

Properties   =   "LOCKTYPE"

Values    =   1

if www_Exec_Method( "LH", "SET", Properties, Values, ReturnValues,"", "", errorText ) then
   * The specified information has been retrieved
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

UNLOCK method

This method unlocks a row or record from an LH table or file.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records.
param3  Not used
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "SWEB_TEST_TABLE1"
TableNames   :=  @RM : "SWEB_TEST_TABLE1"

RowIDs       =   "DELETEME1"
RowIDs       :=  "DELETEME2"

if www_Exec_Method( "LH", "UNLOCK", TableNames, RowIDS, "", "", "", errorText ) then
   * The specified information has been unlocked
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

UNLOCKQ method

This method unlocks all pessimistic locks held by the server. It should normally only be called by the server object.

Argument Description 
param1  Not used. 
param2  Not used. 
param3  Not used. 
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

if www_Exec_Method( "LH", "UNLOCKQ", "", "","", "", "", errorText ) then
   * All locks have been removed
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

WRITE method

This method deletes a row or record from an LH table or file.

Argument Description 
param1  A listing of literal table or file names. This value can be @RM delimited to hold multiple tables or files.
param2  A listing of row or record keys. This value can be @RM delimited to hold multiple rows or records.
param3  Rows to write in an @Rm delimited list. Must conform to column spec of read.
param4  Polymorphic flag. If locking is optimistic then clear the record from the cache after a write (used if the client no longer has the lock) if set to True$. If locking is pessimistic then write regardless of whether client has lock.
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical

TableNames   =   "SWEB_TEST_TABLE1"
TableNames   :=  @RM : "SWEB_TEST_TABLE1"

RowIDs       =   "DELETEME1"
RowIDs       :=  @Rm : "DELETEME2"

* Rows built earlier in program

if www_Exec_Method( "LH", "WRITE", TableNames, RowIDS, Rows, False$, "", errorText ) then
   * The specified information has been written
End Else
   * There has been an error
   GoSub ErrorHandlingSubroutine
End

[top]

Copyright © 2005 The Sprezzatura Group. All rights reserved.