Spring Infrastructure Services

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: GigaSpaces automatically converts POJOs to space Entries, and provides Spring support for local and distributed transactions.

Transparent POJO to Entry Translation

Currently, the Jini/JavaSpaces specification dictates that all space operations should be conducted using Java classes that implement the marker interface net.jini.core.entry.Entry. In order to allow users to use GigaSpaces without modifying existing POJOs, and to ease migration from existing object stores or caching facilities (Hibernate, OJB, etc.) to GigaSpaces, the API exposed to the client allows writing and reading ordinary POJO objects which do not implement the Entry interface. All relevant conversions are done internally in a transparent manner.

To support the conversion, additional meta-data should be supplied via configuration files named *.gs.xml (similar to Hibernate's *.hbm.xml descriptors), or using Java annotations. These files describe those POJO properties which are related to GigaSpaces' behavioral aspects of storing and looking for objects in the space, for example: indexing, fifo enabling, time to live, replicate, and persistence.

Transaction Support

GigaSpaces supports three types of transaction managers: Jini Transaction Manager, Local Transaction Manager, and XA Transaction Manager. Spring has its own transaction management abstraction framework (using PlatformTransactionManager) and already comes with several implementations of it (Jdbc DataSource, JTA/XA, Hibernate, ...).

The GigaSpaces Spring integration implements Spring PlatformTransactionManager for GigaSpaces Local Transaction Manager and Jini Transaction Manager. When using GigaSpaces XA Transaction Manager, Spring built in JtaTransactionManager should be used.

Spring supports both programmatic and declarative transaction management. Declarative transaction management can be defined using Annotations, Javadoc, or Aspects (configured within Spring context). Programmatic transaction management usually uses Spring TransactionTemplate.

With Spring transaction management abstraction, switching from one transactional model to another requires no code changes. Using Spring dependency injection, the actual transaction manager implementation can be switched (usually by changing Spring xml context configuration).

Spring PlatformTranscationManager is responsible for creating, starting, suspending, resuming, committing and rolling back which encompass spaces resources. Often, applications will not interact directly with the PlatformTransactionManager API, but use Spring AOP support to inject transaction interceptors. The transaction interceptor intercepts calls to services available in the application context, and maintains transactional contexts for these calls based on configuration details (which include propagation, isolation, etc). These configuration details may be defined as configuration data in the bean descriptor XML file; using Java 5 annotations in the code; or via any other valid implementation of Spring's TransactionAttributeSource interface.


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels