Direct And Persistent Functions |
There are two types of functions, depending on the way they are identified by credentials
Login/Logout are only required for Persistent sessions with multiple transactions.
Login is actually a "virtual" operation which creates a new Client Session ID. The DBMS is not called on Login. No DBMS login is performed unless Linkar SERVER determines new Database Sessions are required. These operations are not related.
They are useful for applications that require user identification, for instance, to log into an ERP session.
Used for direct and independent communication with the database. Its arguments contain the necessary information to identify the user before returning the required information.
They are used for database access from public websites, for instance online shops.
Linkar licencing is based on the concept of the Client Session. While a Login/Logout session is in progress, a Linkar license is consumed. For this reason it is extremely important to keep these connections as short as possible. Individual volatile transactions consume a Linkar license only for the time during which the transaction is in progress and activity is being performed with the database.
The purpose of Persistent functions, with the virtual Login/Logout, is to eliminate the performance penalty of authentication which is incurred when processing CredentialsOptions. This process is called once for Login and not for every transaction in that session. With Volatile transactions, authentication is performed with each operation. As noted on the EntryPoint page: All REST API transactions are Volatile.
Be sure to use try/catch/finally blocks to capture failed Login operations and to handle failed Volatile transactions. For Persistent transactions, wrap try/catch/finally around code that defines an entire session, to ensure Logout is executed after Login. If Logout is not executed after Login, Client Sessions in the server will not be disposed, resulting in Linkar license consumption until an inactivity timeout on the session occurs. When this happens use Linkar MANAGER and the Client Session page to close disconnected sessions.