Package com.gigaspaces.hibernate

Read/Write through and Write behind using Hibernate CacheLoader and Store implementation classes
Configuration
Hibernate CacheLoader/Store is configured in space schema XML configuration file as a persistent adapter.

See:
          Description

Class Summary
HibernateCacheIterator<T> This class used to fetch data from the database using an iterator.
HibernateCacheLoaderImpl The HibernateCacheLoaderImpl used to load data from external database into GigaSpaces via Hibernate 3.0 ORM.
HibernateCacheStoreImpl The HibernateCacheStoreImpl used to delgate changes done within GigaSpaces into external database via Hibernate 3.0 ORM.
HibernateClassMetadata Stores Space Class meta data
 

Package com.gigaspaces.hibernate Description

Read/Write through and Write behind using Hibernate CacheLoader and Store implementation classes
Configuration
Hibernate CacheLoader/Store is configured in space schema XML configuration file as a persistent adapter.

<space-config>
<persistent>
<enabled>true</enabled>
<StorageAdapterClass>com.j_spaces.sadapter.cache.CacheAdapter</StorageAdapterClass>
<CacheLoaderClass>com.gigaspaces.hibernate.HibernateCacheStoreImpl</CacheLoaderClass>
<StorageAdapterURL>/config/</StorageAdapterURL>
</persistent>
<engine>
<cache_policy>0</cache_policy>
</engine>
</space-config>


You may also use the following space properties:
space-config.persistent.enabled=true
space-config.persistent.StorageAdapterClass=com.j_spaces.sadapter.cache.CacheAdapter
space-config.persistent.CacheLoaderClass=com.gigaspaces.hibernate.HibernateCacheStoreImpl
space-config.persistent.StorageAdapterURL=/config/
space-config.engine.cache_policy=0

You must use space-config.engine.cache_policy=0 (LRU policy) to activate the CacheStore and CacheLoader implementation.
The space-config.persistent.StorageAdapterURL will be used to locate Hibernate hibernate.cfg.xml configuration mapping file.
If space-config.persistent.StorageAdapterURL is not configured the hibernate.cfg.xml will be loaded from the classpath.

It is recommended to configure also the following to control the space memory usage and the eviction behavior:
space-config.engine.memory_usage.enabled=true
space-config.engine.memory_usage.high_watermark_percentage=95
space-config.engine.memory_usage.write_only_block_percentage=85
space-config.engine.memory_usage.write_only_check_percentage=76
space-config.engine.memory_usage.low_watermark_percentage=75
space-config.engine.memory_usage.eviction_batch_size=500

The space-config.persistent.DataBaseName , space-config.persistent.userName and space-config.persistent.password will be passed into the CacheLifeCycleManager constructor to be used by the HibernateCacheLoader/Store implementation.
Note that only one, CacheLoader or CacheStore, but not both, is allowed to be used since CacheStore extends CacheLoader interface.