Class OutboxLockRepository
java.lang.Object
one.tomorrow.transactionaloutbox.repository.OutboxLockRepository
-
Constructor Summary
ConstructorsConstructorDescriptionOutboxLockRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.PlatformTransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanacquireOrRefreshLock(String ownerId, Duration timeout) booleanpreventLockStealing(String ownerId) Locks the outbox lock row for the given owner if it exists.voidreleaseLock(String ownerId)
-
Constructor Details
-
OutboxLockRepository
public OutboxLockRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.PlatformTransactionManager transactionManager)
-
-
Method Details
-
acquireOrRefreshLock
-
preventLockStealing
Locks the outbox lock row for the given owner if it exists. Must be executed inside some outer transaction.- Returns:
- true if the lock could be acquired, otherwise false.
-
releaseLock
-