當前位置: 首頁>>代碼示例>>Java>>正文


Java DatabaseChangeLogLock類代碼示例

本文整理匯總了Java中liquibase.lockservice.DatabaseChangeLogLock的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseChangeLogLock類的具體用法?Java DatabaseChangeLogLock怎麽用?Java DatabaseChangeLogLock使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DatabaseChangeLogLock類屬於liquibase.lockservice包,在下文中一共展示了DatabaseChangeLogLock類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: lockIsStuck

import liquibase.lockservice.DatabaseChangeLogLock; //導入依賴的package包/類
private boolean lockIsStuck() throws LockException {
    DatabaseChangeLogLock lock = getDatabaseChangeLogLock();
    if (lock == null) {
        return false;
    }
    Date lockGranted = lock.getLockGranted();
    Date currentDate = new Date();

    LOGGER.info(format(Messages.CURRENT_LOCK, lockGranted, lock.getLockedBy()));
    LOGGER.info(format(Messages.CURRENT_DATE, currentDate));
    return hasTimedOut(lockGranted, currentDate);
}
 
開發者ID:SAP,項目名稱:cf-mta-deploy-service,代碼行數:13,代碼來源:RecoveringLockService.java

示例2: listLocks

import liquibase.lockservice.DatabaseChangeLogLock; //導入依賴的package包/類
@Override
public DatabaseChangeLogLock[] listLocks() throws LockException {
    if (!lockDb) {
        return new DatabaseChangeLogLock[0];
    }
    return super.listLocks();
}
 
開發者ID:eselyavka,項目名稱:liquibase-impala,代碼行數:8,代碼來源:MetastoreLockService.java

示例3: reportLocks

import liquibase.lockservice.DatabaseChangeLogLock; //導入依賴的package包/類
public void reportLocks(PrintStream out) throws LiquibaseException {
    DatabaseChangeLogLock[] locks = listLocks();
    out.println("Database change log locks for " + getDatabase().getConnection().getConnectionUserName() + "@" + getDatabase().getConnection().getURL());
    if (locks.length == 0) {
        out.println(" - No locks");
    }
    for (DatabaseChangeLogLock lock : locks) {
        out.println(" - " + lock.getLockedBy() + " at " + DateFormat.getDateTimeInstance().format(lock.getLockGranted()));
    }

}
 
開發者ID:hongliangpan,項目名稱:manydesigns.cn,代碼行數:12,代碼來源:Liquibase.java

示例4: getDatabaseChangeLogLock

import liquibase.lockservice.DatabaseChangeLogLock; //導入依賴的package包/類
private DatabaseChangeLogLock getDatabaseChangeLogLock() throws LockException {
    DatabaseChangeLogLock[] locks = listLocks();
    return (locks.length > 0) ? locks[0] : null;
}
 
開發者ID:SAP,項目名稱:cf-mta-deploy-service,代碼行數:5,代碼來源:RecoveringLockService.java

示例5: listLocks

import liquibase.lockservice.DatabaseChangeLogLock; //導入依賴的package包/類
/**
 * Display change log lock information.
 */
public DatabaseChangeLogLock[] listLocks() throws LiquibaseException {
    checkDatabaseChangeLogTable(false, null, null);

    return LockService.getInstance(getDatabase()).listLocks();
}
 
開發者ID:hongliangpan,項目名稱:manydesigns.cn,代碼行數:9,代碼來源:Liquibase.java


注:本文中的liquibase.lockservice.DatabaseChangeLogLock類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。