Skip Headers

# Historical Queries

Previous

Next

By default, a session represents a view of the most current version of objects and when you execute a query in that session, it returns the most current version of selected objects.

If your data source maintains past or historical versions of objects, you can configure TopLink to access this historical data (see "Historical Sessions").

Once you configure TopLink to take advantage of this historical data, you can access historical versions using the historical queries that Table: Historical Queries summarizes.

Note: Flashback queries do not support view selects. This means you cannot use a flashback query on objects with an inheritance policy for read-all-subclasses views. For more information, see "Understanding Descriptors and Inheritance".

Historical Queries

Historical Query Type | Session | Cache | Must set `maintainCache` to false? | Query both current and historical versions?
--- | --- | --- | --- | ---

Using an ObjectLevelReadQuery With an AsOfClause

RegularFoot 1

- Global

- Read and write

- Contains current versions

Yes

No

Using an ObjectLevelReadQuery With Expression Operator asOf

RegularFootref 1

- Global

- Read and write

- Contains current versions

Yes

Yes

Using an ObjectLevelReadQuery in a Historical Session

HistoricalFoot 2

- Isolated

- Read-only

- Contains static snapshot as of specified time

No

No

Footnote 1 A server or database session based on an `OraclePlatform` for an Oracle9i (or later) or based on a TopLink `HistoryPolicy`.

Footnote 2 A session returned by a server or database session based on an `OraclePlatform` or TopLink `HistoryPolicy` using the `acquireHistoricalSession` method passing in an `AsOfClause`.