GigaSpaces External Data Source interface is the key middleware connection link for loading and storing data to and from persistent data sources.
.NET persistency is a GigaSpaces implementation on top of Java SQLDataProvider and BulkPersister interfaces.
Before you begin, it is recommended to read the External Data Source section.
You can either use GigaSpaces NHibernate implementation, or create a custom implementation:
The following code demonstrates how to start an embedded space with GigaSpaces NHibernate SqlDataSource implementation as its External Data Source.
Before using the ExternalDataSource.NHibernate practice, compile it by calling <GigaSpaces Root>\dotnet\practices\ExternalDataSource\NHibernate\build.bat.
You can create your own NHibernate session factory and pass it to the NHibernateExternalDataSource constructor. In this case, there's no need to use SpaceConfig.ExternalDataSourceConfig.CustomProperties.
For a demonstration of how to start a partitioned-sync2backup cluster with asynchronous NHibernate persistency, refer to the .NET Persistency NHibernate External Data Source Walkthrough section.
A custom .NET SqlDataSource implementation can be used as well.
The following code demonstrates how to start an embedded space with a custom .NET SqlDataSource implementation as its External Data Source.
The number of objects passed between the .Net IDataEnumerator (Part of the ISqlDataSource interface) to the server on each iteration can be changed, its default value is set to 1000.
This can be done by adding a custom property to the ExternalDataSourceConfig object.
To enable the .NET ExternalDataSource adapter logging, refer to the GigaSpaces Logging section.
To create a custom implementation, implement the GigaSpaces.Core.Persistency.ISqlDataSource interface.
Before creating a custom implementation, read the following considerations.
See an example for the NHibernate implementation under <GigaSpaces Root>\dotnet\practices\ExternalDataSource\NHibernate.