Session Object

English Query

English Query

Session Object

Represents the current state of the end-user session with the English Query server.

Properties
ClarifySpellingErrors Property Indicates whether English Query prompts end users for clarification of spelling errors or corrects spelling errors without prompting.
DBMSType Property (Session Object) Specifies the type of the primary database used in this session.
DBMSVersion Property Specifies the version of the database used in this session.
DomainInfo Property Contains the model information (the DomainInfo object) for the Session object.
FallbackDBMSType Property Specifies the type of database to use if a query cannot be generated for the primary database.
FallbackDBMSVersion Property Specifies the version of the database to use if a query cannot be generated for the primary database.
RetainContext Property Retains user context between questions for the Session object.
Methods
ClearContext Method Clears the conversation context.
InitDomain Method Creates (if necessary) the Domain object and attaches it to the Session object.
ParseRequest Method Parses an English question or request into a collection of database queries or other response types for the attached model.
SetDBMS Method Sets the primary database type and version for which the query is generated.
SetFallbackDBMS Method Sets the alternate database type and version for which a query is generated if one can be generated for the primary database.

Remarks

The Session object encapsulates the state of a user session with the English Query server. It is initialized for a particular model and supports parsing English Query requests for that model into a collection of well-defined commands that the client can then execute. English requests are interpreted within the context of the Session object.

Typically, the English Query server parses an English question into a command to execute a database query. The client then executes the query statement (by dispatching the database query to a database object) and displays the resulting data to the end user.

Before the Session object can parse a user's English questions, it must be initialized for a particular model by calling the InitDomain method.

The user's question can then be processed by first parsing it with the ParseRequest method and then taking the appropriate action, depending on the type of response returned from ParseRequest.

Before the Session object is released, the client should call EndCommands to retrieve a collection of commands that cleanly terminates the current user conversation with the application. These commands are necessary to remove any temporary tables that are created during the session as a result of executing SQL statements.

The English Query server supports multiple, concurrent Session objects, each maintaining the unique state of a particular user conversation context for clarifications, preferences, and the model. The lifetime of a Session object, as with all COM objects, is controlled by the client.

See Also

DomainInfo Object

EndCommands Collection