20.01.2014 Views

SIS - Application Programmatic Interface, Reference Manual - ICS ...

SIS - Application Programmatic Interface, Reference Manual - ICS ...

SIS - Application Programmatic Interface, Reference Manual - ICS ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SIS</strong>- <strong>Application</strong> <strong>Programmatic</strong> <strong>Interface</strong>, <strong>Reference</strong> <strong>Manual</strong><br />

be used in the future to validate the requested connection. Currently they are<br />

not used but the should not be NULL.<br />

int release_<strong>SIS</strong>_Session(int sessionID)<br />

This function should be called to release the session (sessionID) created by<br />

create_<strong>SIS</strong>_CS_Session() or create_<strong>SIS</strong>_SA_Session().<br />

6.1.2 Connecting to the database<br />

int open_connection(int sessionID)<br />

This function is used to open a connection to the <strong>SIS</strong> server determined by<br />

create_<strong>SIS</strong>_CS_Session or create_<strong>SIS</strong>_SA_Session function. With the first<br />

implementation described, this function opens the communication socket that<br />

establishes the communication with the server. With the second<br />

implementation this function just returns successfully. Between an<br />

open_connection() and a close_connection() any number of calls to<br />

begin_query()/end_query() and begin_transaction/end_transaction() can<br />

be performed.<br />

int close_connection (int sessionID)<br />

This function is used to close a connection to a server, previously opened with<br />

open_connection(). With the first implementation described this function<br />

closes the communication sockets, that is it terminates the communication<br />

with the server. With the second implementation this function just returns<br />

successfully.<br />

6.1.3 Performing queries and transactions<br />

int begin_query(int sessionID)<br />

Starts a querying session. During this session all API query functions can be<br />

called to retrieve information from the <strong>SIS</strong> base. Possible return values are:<br />

APIFail(-1), API_DB_CHANGED(0), API_DB_NOT_CHANGED(1),<br />

API_HASH_TABLES_NEED_EXPANSION(4), API_HASH_TABLES_EXPANDING(8).<br />

int end_query(int sessionID)<br />

Ends a querying session.<br />

int begin_transaction(int sessionID)<br />

Starts a transaction session. During this session API query and update<br />

functions may be called to retrieve and modify information from the <strong>SIS</strong> base.<br />

The system will not permit operations that will leave the database inconsistent.<br />

Possible return values are: APIFail(-1), API_DB_CHANGED(0),<br />

API_DB_NOT_CHANGED(1),<br />

API_HASH_TABLES_NEED_EXPANSION(4),<br />

API_HASH_TABLES_EXPANDING(8).<br />

int end_transaction(int sessionID)<br />

Ends a transaction session by committing the changes to the database files. It<br />

returns 1 on success, APIFail(-1) on failure. In case of failure the operations<br />

August 2002/v2.2.2 -10- <strong>ICS</strong>-FORTH

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!