Interface TransactionProvider

All Superinterfaces:
AutoCloseable, Closeable, SpaceTransactionProvider
All Known Implementing Classes:
DefaultTransactionProvider

public interface TransactionProvider extends SpaceTransactionProvider
A transaction provider is used to support declarative transactions. It is usually used with a GigaSpace implementation to declaratively provide on going transactions to JavaSpace APIs.

The transaction provider usually interacts with a transaction manager (for example, Spring's PlatformTransactionManager) in order to get the current running transactions. It allows a transactional context to be passed to the current transaction method, though it doesn't have to be used.

Author:
kimchy
  • Method Details

    • getCurrentTransaction

      Transaction.Created getCurrentTransaction(Object transactionalContext, IJSpace space)
      Returns the currently running transaction (usually managed externally/declarative). A transactional context can be passed and optionally used in order to fetch the current running transaction.

      If no transaction is currently executing, null value will be returned. This usually means that the operation will be performed without a transaction.

      Parameters:
      transactionalContext - Transactional context to (optionally) fetch the transaction by
      space - The actual Space this operation will be performed on
      Returns:
      The transaction object to be used with IJSpace operations. Can be null.
    • getCurrentTransactionIsolationLevel

      int getCurrentTransactionIsolationLevel(Object transactionalContext)
      Returns the currently running transaction isolation level (mapping to Spring TransactionDefinition.getIsolationLevel() values). A transactional context can be passed and optionally used in order to fetch the current running transaction.
      Parameters:
      transactionalContext - Transactional context to (optionally) fetch the transaction by
      Returns:
      The transaction isolation level mapping to Spring TransactionDefinition.getIsolationLevel().