Table of Contents [+/-]
This section explains the concepts of connections and sessions as used by the X DevAPI. Code examples for connecting to a MySQL Document Store (see Using MySQL as a Document Store and using sessions are provided.
An X DevAPI session is a high-level database session concept that is different from working with traditional low-level MySQL connections. Sessions can encapsulate one or more actual MySQL connections and can use either the classic MySQL protocol or the X Protocol. Use of this higher abstraction level decouples the physical MySQL setup from the application code. Sessions provide full support of X DevAPI and limited support of SQL. When a low-level MySQL connection to a single MySQL instance is needed this is still supported by using a ClassicSession, which provides full support of SQL.
Before looking at the concepts in more detail, the following examples show how to connect using a session.