Search in sources :

Example 1 with DBLockProviderFactory

use of org.keycloak.models.dblock.DBLockProviderFactory in project keycloak by keycloak.

the class DBLockTest method before.

@Before
public void before() throws Exception {
    inComittedTransaction(1, (session, i) -> {
        // Set timeouts for testing
        DBLockManager lockManager = new DBLockManager(session);
        DBLockProviderFactory lockFactory = lockManager.getDBLockFactory();
        lockFactory.setTimeouts(LOCK_RECHECK_MILLIS, LOCK_TIMEOUT_MILLIS);
        // Drop lock table, just to simulate racing threads for create lock table and insert lock record into it.
        lockManager.getDBLock().destroyLockInfo();
        return null;
    });
}
Also used : DBLockProviderFactory(org.keycloak.models.dblock.DBLockProviderFactory) DBLockManager(org.keycloak.models.dblock.DBLockManager) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 DBLockManager (org.keycloak.models.dblock.DBLockManager)1 DBLockProviderFactory (org.keycloak.models.dblock.DBLockProviderFactory)1