Skip to main content

%Storage.SQL

abstract class %Storage.SQL extends %Library.Storage

The %Storage.SQL class contains a set of storage interface methods that use embedded SQL statements, as well as an advanced set of data mapping definition, to provide a way to layer objects on top of pre-existing InterSystems IRIS data structures.

The storage interface methods, which are implemented as method generators, work in conjunction with the persistent interface methods of the %Persistent class to provide persistent behavior for objects.

The methods of %Storage.SQL are not meant to be called directly. Use the methods of the %Persistent class which, in turn, call the appropriate %Storage.Persistent method.

Method Inventory

Parameters

parameter OBJECTSPULLTRIGGERS = 1;
parameter RESOURCEREQUIRED = %Admin_Secure;
parameter STORAGECOMPILERCLASS = %Compiler.Storage.SQL;

Methods

classmethod %Exists(oid As %ObjectIdentity = "") as %Boolean
%Exists() Check to see if an OID exists in the extent of this class...
classmethod %LockExtent(shared As %Boolean = 0) as %Status

Acquires a lock on the entire extent of the class. If shared is true (1) a shared lock is acquired; otherwise (the default, 0) an exclusive lock is acquired. If the requested lock cannot be acquired, a failure %Status value is returned.

This method is normally generated by the storage class for persistent classes using %Storage.SQL.

classmethod %LockId(id As %String, shared As %Boolean = 0, timeout As %Integer) as %Status

Acquires a lock on the single object identified by id. If shared is true (1) a shared lock is acquired; otherwise (the default, 0) an exclusive lock is acquired. timeout, if specified, is the number of seconds to wait for the lock before returning a failure %Status; if omitted, the system default lock timeout is used.

This method is normally generated by the storage class for persistent classes using %Storage.SQL.

classmethod %PurgeIndices(idxlist As %List = "", lockExtent As %Boolean = 0, pIgnoreIndexList As %RawString = "") as %Status

Deletes all entries from each index specified in the idxlist argument. If idxlist is empty then all indices defined for the class are purged. The index definitions themselves remain intact; only the stored index entries are removed.

For a class that uses %Storage.SQL, indices are identified by their storage SQL map name (see %BuildIndices()), and that name may differ from the class index name.

If lockExtent is 1, an extent lock is acquired before purging and released when the purge completes. The default is 0 (no extent lock).

If pIgnoreIndexList is defined, it should be a $listOpens in a new tab of index names that should not be purged. This allows you to purge all indices except those listed. The default is "", meaning all indices, or all indices specified in idxlist, are purged.

If %OnBeforePurgeIndices() is implemented and runnable it is called just prior to performing the purge; returning an error status causes %PurgeIndices to exit without purging. If %OnAfterPurgeIndices() is implemented and runnable it is called after all index structures have been purged.

Returns a %Status value indicating success or failure. This method is normally generated by the storage class for persistent classes using %Storage.SQL.

classmethod %UnlockExtent(shared As %Boolean = 0, immediate As %Boolean = 0) as %Status

Releases a lock on the entire extent of the class. The type of lock released is determined by shared (1 = shared, 0 = exclusive), which should match the lock acquired by %LockExtent(). If immediate is true (1) the lock is released immediately; otherwise it is decremented following normal transaction lock-release behavior.

This method is normally generated by the storage class for persistent classes using %Storage.SQL.

classmethod %UnlockId(id As %String, shared As %Boolean = 0, immediate As %Boolean = 0) as %Status
Release locks held on an object (identified by the id parameter). If shared is true then the lock released is a shared lock. If immediate is true then release the lock immediately (lock not held until completion of the current transaction)

Inherited Members

Inherited Methods

FeedbackOpens in a new tab