Provides an implementation of
DataService
based on {@link DataStoreImpl}.
The {@link #DataServiceImpl constructor} requires the com.sun.sgs.app.name
property, and supports both these public configuration properties and the following additional properties:
- Property:
{@value #DATA_STORE_CLASS_PROPERTY}
Default: com.sun.sgs.impl.service.data.store.net.DataStoreClient
unless the {@code com.sun.sgs.node.type} property is {@code singleNode}, which defaults to com.sun.sgs.impl.service.data.store.DataStoreImpl
- The name of the class that implements {@link DataStore}. The class should be public, not abstract, and should provide a public constructor with {@link Properties} and {@link AccessCoordinator} parameters.
- Property:
{@value #DETECT_MODIFICATIONS_PROPERTY}
Default: true
- Whether to automatically detect modifications to managed objects. If set to something other than
true
, then applications need to call {@link DataManager#markForUpdate DataManager.markForUpdate} or {@link ManagedReference#getForUpdate ManagedReference.getForUpdate} for any modified objects to make surethat the modifications are recorded by the DataService
.
- Property:
{@value #DEBUG_CHECK_INTERVAL_PROPERTY}
Default: Integer.MAX_VALUE
- The number of
DataService
operations to skip between checks of the consistency of the managed references table. Note that the number of operations is measured separately for each transaction. This property is intended for use in debugging.
- Property:
{@value #OPTIMISTIC_WRITE_LOCKS}
Default: false
- Whether to wait until commit time to obtain write locks. If
false
, which is the default, the service acquires write locks as soon as it knows that an object is being modified. If true
, the service delays obtaining write locks until commit time, which may improve performance in some cases, typically when there is low contention. Note that setting this flag to true
does not delay write locks when removing objects.
- Property:
{@value #TRACK_STALE_OBJECTS_PROPERTY}
Default: false
- Whether to track references to stale managed objects. If
true
, the DataService
keeps track of persistent or removed objects from completed transactions and throws {@link TransactionNotActiveException} if the application refersto those objects from another transaction.
The constructor also passes the properties to the {@link DataStoreImpl}constructor, which supports additional properties.
This class uses the {@link Logger} namedcom.sun.sgs.impl.service.data.DataServiceImpl
to log information at the following logging levels:
- {@link Level#SEVERE SEVERE} - Initialization failures
- {@link Level#CONFIG CONFIG} - Constructor properties, data serviceheaders
- {@link Level#FINE FINE} - Task scheduling operations, managed referencetable checks
- {@link Level#FINER FINER} - Transaction operations
- {@link Level#FINEST FINEST} - Name, object, and reference operations
It also uses an additional {@code Logger} named {@code com.sun.sgs.impl.service.data.DataServiceImpl.detect.modifications} to loginformation about managed objects that are found to be modified but were not marked for update. Note that this logging output will only be performed if the {@code com.sun.sgs.impl.service.data.DataServiceImpl.detect.modifications} propertyis {@code true}.
- {@code FINEST} - Modified object was not marked for update
In addition, operations that throw a {@link TransactionAbortedException}will log the failure to the {@code Logger} named {@code com.sun.sgs.impl.service.data.DataServiceImpl.abort}, to make it easier to debug concurrency conflicts by just logging aborts.