congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DatabaseChangeLogLock.getLockGranted
Code IndexAdd Tabnine to your IDE (free)

How to use
getLockGranted
method
in
liquibase.lockservice.DatabaseChangeLogLock

Best Java code snippets using liquibase.lockservice.DatabaseChangeLogLock.getLockGranted (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.lockserviceDatabaseChangeLogLockgetLockGranted

Popular methods of DatabaseChangeLogLock

  • getLockedBy

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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