Tabnine Logo
DatabaseChangeLogLock
Code IndexAdd Tabnine to your IDE (free)

How to use
DatabaseChangeLogLock
in
liquibase.lockservice

Best Java code snippets using liquibase.lockservice.DatabaseChangeLogLock (Showing top 2 results out of 315)

origin: cloudfoundry-incubator/multiapps-controller

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);
}
origin: vmware/admiral

private static void releaseLockOnTimeout(Liquibase liquibase)
    throws LiquibaseException, UnsupportedEncodingException {
  if (LOCK_RELEASE_TIMEOUT_MINUTES <= 0) {
    return;
  }
  for (DatabaseChangeLogLock lock : liquibase.listLocks()) {
    long elapsedMinutes = TimeUnit.MILLISECONDS
        .toMinutes(System.currentTimeMillis() - lock.getLockGranted().getTime());
    if (elapsedMinutes >= LOCK_RELEASE_TIMEOUT_MINUTES) {
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      liquibase.reportLocks(new PrintStream(os));
      logger.warning(String.format("Releasing liquibase locks after %d minutes: %s",
          elapsedMinutes, os.toString(Utils.CHARSET)));
      liquibase.forceReleaseLocks();
      break;
    }
  }
}
liquibase.lockserviceDatabaseChangeLogLock

Most used methods

  • getLockGranted
  • getLockedBy

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JPanel (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now