[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Collapse]eXpress Persistent Objects
 [Expand]Product Information
 [Expand]Getting Started
 [Collapse]Feature Center
  [Expand]Data Representation
  [Expand]Object Relational Mapping
  [Collapse]Connecting to a Data Store
    Data Access Layer
    Object Access Layer
    Unit of Work
    Cached Data Store
    Transferring Data via WCF Services
  [Expand]Data Exchange and Manipulation
  [Expand]Querying a Data Store
  [Expand]Using XPO in Web Applications
 [Expand]Design-Time Features
 [Expand]Member Tables
 [Expand]API Reference
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


In terms of XPO, the Session object represents a cache of the persistent objects that have been instantiated during data manipulations with a data store. A session uses a Data Access Layer (DAL for short) to retrieve the persistent objects from a data store and store them. A session automatically creates a DAL provided that the connection properties (such as the database name, user name and password) have been specified.

By default, XPO uses the MS Access OLEDB provider, assumes that the database has the same name as the application, and it resides in the application folder. If the database does not exist, XPO creates it. These default settings can be accessed and customized via the static properties of the XpoDefault class. You can also create and work with your own Session object(s).

You can also use Unit of Work instead of sessions. When working with sessions you need to save each persistent object individually. While working with Units of Work all the changes made to persistent objects are automatically saved to a data store by making a single method call. This is because it tracks every change to every persistent object.

The connection is alive while a session is active, i.e. until the Session.Disconnect method is explicitly called. Disconnect is implicitly called when a Session object is disposed of.

Expanded Concepts

Expanded Task-Based Help

Expanded Online Knowledge Base

Is this topic helpful?​​​​​​​