Class TransactionManager


  • public class TransactionManager
    extends Object
    Tracks active transactions and returns references of them.
    • Constructor Detail

      • TransactionManager

        public TransactionManager​(ScheduledExecutorService scheduledExecutorService,
                                  GraphManager graphManager,
                                  long transactionTimeoutMs,
                                  int maxConcurrentTransactions,
                                  long perGraphCloseMs)
        Creates a new TransactionManager with the specified configuration.
        Parameters:
        scheduledExecutorService - Scheduler for timeout management
        graphManager - The graph manager for accessing traversal sources
        transactionTimeoutMs - Timeout in milliseconds before auto-rollback
        maxConcurrentTransactions - Maximum number of concurrent transactions allowed
    • Method Detail

      • destroy

        public void destroy​(String id)
        Removes a transaction from the active transactions map. Called when a transaction is committed, rolled back, or otherwise closed.
        Parameters:
        id - The transaction ID to remove
      • getActiveTransactionCount

        public int getActiveTransactionCount()
        Returns the number of currently active transactions.
        Returns:
        the count of active transactions
      • shutdown

        public void shutdown()
        Shuts down the transaction manager, rolling back all active transactions.

        This method should be called during server shutdown to ensure all transactions are properly cleaned up. It blocks until all rollbacks complete.