Example usage for org.springframework.integration.jdbc.lock DefaultLockRepository setTimeToLive

List of usage examples for org.springframework.integration.jdbc.lock DefaultLockRepository setTimeToLive

Introduction

In this page you can find the example usage for org.springframework.integration.jdbc.lock DefaultLockRepository setTimeToLive.

Prototype

public void setTimeToLive(int timeToLive) 

Source Link

Document

Specify the time (in milliseconds) to expire dead locks.

Usage

From source file:org.springframework.cloud.task.configuration.SingleInstanceTaskListener.java

private LockRegistry getDefaultLockRegistry(long executionId) {
    DefaultLockRepository lockRepository = new DefaultLockRepository(this.dataSource,
            String.valueOf(executionId));
    lockRepository.setPrefix(this.taskProperties.getTablePrefix());
    lockRepository.setTimeToLive(this.taskProperties.getSingleInstanceLockTtl());
    lockRepository.afterPropertiesSet();
    return new JdbcLockRegistry(lockRepository);
}