Interface PendingLockManager


  • public interface PendingLockManager
    A manager that checks and waits for older topology transaction with conflicting keys.
    Since:
    8.0
    Author:
    Pedro Ruivo
    • Method Detail

      • awaitPendingTransactionsForKey

        long awaitPendingTransactionsForKey​(org.infinispan.context.impl.TxInvocationContext<?> ctx,
                                            java.lang.Object key,
                                            long time,
                                            java.util.concurrent.TimeUnit unit)
                                     throws java.lang.InterruptedException
        It waits for any transaction with older topology id to complete that may have the lock for key acquired.
        Parameters:
        ctx - the TxInvocationContext.
        key - the key to check.
        time - timeout.
        unit - TimeUnit of time.
        Returns:
        the remaining timeout.
        Throws:
        java.lang.InterruptedException - if the thread is interrupted while waiting.
      • awaitPendingTransactionsForAllKeys

        long awaitPendingTransactionsForAllKeys​(org.infinispan.context.impl.TxInvocationContext<?> ctx,
                                                java.util.Collection<java.lang.Object> keys,
                                                long time,
                                                java.util.concurrent.TimeUnit unit)
                                         throws java.lang.InterruptedException
        It waits for any transaction with older topology id to complete that may have the lock for any key in keys acquired.
        Parameters:
        ctx - the TxInvocationContext.
        keys - the keys to check.
        time - timeout.
        unit - TimeUnit of time.
        Returns:
        the remaining timeout.
        Throws:
        java.lang.InterruptedException - if the thread is interrupted while waiting.