This section covers the features of GemFire transactions.
GemFire transactions provide the following features:
- Basic transaction properties: atomicity, consistency, isolation, and durability
- Rollback and commit operations along with standard GemFire cache operations
- Ability to suspend and resume transactions
- High concurrency and high performance
- Transaction statistics gathering and archiving
- Compatibility with Java Transaction API (JTA) transactions, using either GemFire JTA or a third-party implementation
- Ability to use GemFire as a “last resource” in JTA transactions with multiple data sources to guarantee transactional consistency
Types of Transactions
GemFire supports two kinds of transactions: GemFire cache transactions and JTA global transactions.
GemFire cache transactions are used to group the execution of cache operations and to gain the control offered by transactional commit and rollback. Applications create cache transactions by using an instance of the GemFire
CacheTransactionManager. During a transaction, cache operations are performed and distributed through GemFire as usual. See GemFire Cache Transactions for details on GemFire cache transactions and how these transactions work.
JTA global transactions allow you to use the standard JTA interface to coordinate GemFire transactions with JDBC transactions. When performing JTA global transactions, you have the option of using GemFire’s own implementation of JTA or a third party’s implementation (typically application servers such as WebLogic or JBoss) of JTA. In addition, some third party JTA implementations allow you to set GemFire as a “last resource” to ensure transactional consistency across data sources in the event that GemFire or another data source becomes unavailable. For global transactions, applications use
java:/UserTransaction to start and terminate transactions while GemFire cache operations are performed in the same manner as regular GemFire cache transactions. See JTA Global Transactions with GemFire for details on JTA Global transactions.
You can also coordinate a GemFire cache transaction with an external database by specifying database operations within cache and transaction application plug-ins (CacheWriters/CacheListeners and TransactionWriters/TransactionListeners.) This is an alternative to using JTA transactions. See How to Run a GemFire Cache Transaction that Coordinates with an External Database.