Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Collapse]Cross-Platform Core Libraries
 [Collapse]DevExpress ORM Tool
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Fundamentals
  [Collapse]Feature Center
   [Expand]Data Representation
   [Expand]Object Relational Mapping
   [Collapse]Connecting to a Data Store
     Cached Data Store
     Data Access Layer
     Object Access Layer
     Session
     Transferring Data via WCF Services
     Unit of Work
   [Expand]Data Exchange and Manipulation
   [Expand]Querying a Data Store
   [Expand]Using XPO in Web Applications
  [Expand]Concepts
  [Expand]Design-Time Features
  [Expand]Examples
  [Expand]Member Tables
 [Expand]DevExpress Data Library
 [Expand]Miscellaneous
 [Expand]API Reference
[Expand]Tools and Utilities
 End-User Documentation

Session

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

How would you rate this topic?​​​​​​​