Data Consistency for Queries

When querying a table, the query processes the data in the table at the time the query is initiated.

As the table data is distributed across the nodes in a data grid, ActiveSpaces provides properties that affect whether or not the table data used for the query is consistent, with respect to partially committed transactions, across all nodes of the data grid. There are two data consistency levels that can be applied to queries:
Global Snapshot (default level)
Data retrieval is synchronized across copysets to ensure that the data accessed by the query is from committed transactions.
Snapshot
This consistency level makes no guarantee that the data accessed by the query is not from partially committed transactions. With snapshot level consistency it is possible that data from a committed transaction has not been written to all copysets when the query executes. Therefore the rows of the query result can contain data from a partially committed transaction.

For both table iterators and session statements, you can specify a consistency property when the objects are first created. If a consistency property is not specified, the default consistency level of global snapshot is used.

For statements, you can override the consistency level each time the query is run by specifying a consistency property when the method to execute the query is invoked.

Query snapshots are inexpensive if the table data changes slowly, but can become expensive if the data changes rapidly. To limit memory growth within data grid components, administrators can limit the number of concurrent snapshots.

Regardless of the data consistency level used, rows returned for a query are not locked by the session.

For more information on setting statement properties, see Properties.

For more information on setting table iterator properties, see Table Iterator.