Cayenne User Documentation
DataContext

## DataContext

In most applications `org.apache.cayenne.access.DataContext` is the main user access point to all Cayenne functionality. It provides query execution facilities as well as object state management functions. Applications rarely directly deal with access or mapping objects beyond DataContext.

One of the important features of DataContext is that it isolates changes made in a user session from other users. With this in mind, DataContext normally has a session scope. "Session" can have different meanings in different types of applications. Good example is an HttpSession in a web application. Each one of HttpSessions will normally need a single instance of DataContext.

### Sections

1. Obtaining DataContext
2. Running Queries
3. DataObject State Management
4. Moving Objects Between Contexts
5. DataContextDelegate
6. DataContextFactory
7. Nested DataContexts
8. ObjectContext Memory Management

.
Copyright ©2001-2008 Apache Software Foundation