会晤(session)对象
会晤对象提供用以创建命令(commands)及行集(rowset)的方法,以及创建与修改表(tables)及索引(indexes)的方法。
CoType TSession {
[mandatory] interface IGetDataSource;
[mandatory] interface IOpenRowset;
[mandatory] interface ISessionProperties;
[optional] interface IAlterIndex;
[optional] interface IAlterTable;
[optional] interface IBindResource;
[optional] interface IConnectionPointContainer;
[optional] interface ICreateRow;
[optional] interface IDBCreateCommand;
[optional] interface IDBSchemaRowset;
[optional] interface IIndexDefinition;
[optional] interface ISupportErrorInfo;
[optional] interface ITableCreation;
[optional] interface ITableDefinition;
[optional] interface ITableDefinitionWithConstraints;
[optional] interface ITransaction;
[optional] interface ITransactionJoin;
[optional] interface ITransactionLocal;
[optional] interface ITransactionObject;
}
消费者调用数据源对象中的IDBCreateSession::CreateSession创建一次会晤(session)。一个数据源对象支持多个会晤,因此也支持多个事务(transaction)。由于会晤,消费者可以:
- 通过调用IDBCreateCommand::CreateCommand创建命令对象。一次会晤可以支持多个命令对象。一些提供者不支持命令对象。
- 通过调用IOpenRowset::OpenRowset创建行集对象。相当于创建覆盖一张单表的行集。行集是被所有提供者支持的。