Codota Logo
LockException
Code IndexAdd Codota to your IDE (free)

How to use
LockException
in
org.quartz.impl.jdbcjobstore

Best Java code snippets using org.quartz.impl.jdbcjobstore.LockException (Showing top 20 results out of 315)

  • Common ways to obtain LockException
private void myMethod () {
LockException l =
  • Codota IconString str;Throwable cause;new LockException(str, cause)
  • Smart code suggestions by Codota
}
origin: quartz-scheduler/quartz

/**
 * Helper method to get the current <code>{@link javax.transaction.Transaction}</code>
 * from the <code>{@link javax.transaction.TransactionManager}</code> in JNDI.
 * 
 * @return The current <code>{@link javax.transaction.Transaction}</code>, null if
 * not currently in a transaction.
 */
protected Transaction getTransaction() throws LockException{
  InitialContext ic = null; 
  try {
    ic = new InitialContext(); 
    TransactionManager tm = (TransactionManager)ic.lookup(transactionManagerJNDIName);
    
    return tm.getTransaction();
  } catch (SystemException e) {
    throw new LockException("Failed to get Transaction from TransactionManager", e);
  } catch (NamingException e) {
    throw new LockException("Failed to find TransactionManager in JNDI under name: " + transactionManagerJNDIName, e);
  } finally {
    if (ic != null) {
      try {
        ic.close();
      } catch (NamingException ignored) {
      }
    }
  }
}

origin: quartz-scheduler/quartz

protected void releaseLock(String lockName, boolean doIt) {
  if (doIt) {
    try {
      getLockHandler().releaseLock(lockName);
    } catch (LockException le) {
      getLog().error("Error returning lock: " + le.getMessage(), le);
    }
  }
}
origin: quartz-scheduler/quartz

/**
 * Helper method to get the current <code>{@link javax.transaction.Transaction}</code>
 * from the <code>{@link javax.transaction.TransactionManager}</code> in JNDI.
 * 
 * @return The current <code>{@link javax.transaction.Transaction}</code>, null if
 * not currently in a transaction.
 */
protected Transaction getTransaction() throws LockException{
  InitialContext ic = null; 
  try {
    ic = new InitialContext(); 
    TransactionManager tm = (TransactionManager)ic.lookup(transactionManagerJNDIName);
    
    return tm.getTransaction();
  } catch (SystemException e) {
    throw new LockException("Failed to get Transaction from TransactionManager", e);
  } catch (NamingException e) {
    throw new LockException("Failed to find TransactionManager in JNDI under name: " + transactionManagerJNDIName, e);
  } finally {
    if (ic != null) {
      try {
        ic.close();
      } catch (NamingException ignored) {
      }
    }
  }
}

origin: quartz-scheduler/quartz

protected void releaseLock(String lockName, boolean doIt) {
  if (doIt) {
    try {
      getLockHandler().releaseLock(lockName);
    } catch (LockException le) {
      getLog().error("Error returning lock: " + le.getMessage(), le);
    }
  }
}
origin: quartz-scheduler/quartz

/**
 * Execute the SQL select for update that will lock the proper database row.
 */
@Override
protected void executeSQL(Connection conn, final String lockName, final String expandedSQL, final String expandedInsertSQL) throws LockException {
  SQLException lastFailure = null;
  for (int i = 0; i < RETRY_COUNT; i++) {
    try {
      if (!lockViaUpdate(conn, lockName, expandedSQL)) {
        lockViaInsert(conn, lockName, expandedInsertSQL);
      }
      return;
    } catch (SQLException e) {
      lastFailure = e;
      if ((i + 1) == RETRY_COUNT) {
        getLog().debug("Lock '{}' was not obtained by: {}", lockName, Thread.currentThread().getName());
      } else {
        getLog().debug("Lock '{}' was not obtained by: {} - will try again.", lockName, Thread.currentThread().getName());
      }
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException _) {
        Thread.currentThread().interrupt();
      }
    }
  }
  throw new LockException("Failure obtaining db row lock: " + lastFailure.getMessage(), lastFailure);
}

origin: com.opensymphony.quartz/com.springsource.org.quartz

protected void releaseLock(Connection conn, String lockName, boolean doIt) {
  if (doIt && conn != null) {
    try {
      getLockHandler().releaseLock(conn, lockName);
    } catch (LockException le) {
      getLog().error("Error returning lock: " + le.getMessage(), le);
    }
  }
}
 
origin: quartz-scheduler/quartz

/**
 * Execute the SQL select for update that will lock the proper database row.
 */
@Override
protected void executeSQL(Connection conn, final String lockName, final String expandedSQL, final String expandedInsertSQL) throws LockException {
  SQLException lastFailure = null;
  for (int i = 0; i < RETRY_COUNT; i++) {
    try {
      if (!lockViaUpdate(conn, lockName, expandedSQL)) {
        lockViaInsert(conn, lockName, expandedInsertSQL);
      }
      return;
    } catch (SQLException e) {
      lastFailure = e;
      if ((i + 1) == RETRY_COUNT) {
        getLog().debug("Lock '{}' was not obtained by: {}", lockName, Thread.currentThread().getName());
      } else {
        getLog().debug("Lock '{}' was not obtained by: {} - will try again.", lockName, Thread.currentThread().getName());
      }
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException _) {
        Thread.currentThread().interrupt();
      }
    }
  }
  throw new LockException("Failure obtaining db row lock: " + lastFailure.getMessage(), lastFailure);
}

origin: quartz/quartz-all

protected void releaseLock(Connection conn, String lockName, boolean doIt) {
  if (doIt && conn != null) {
    try {
      getLockHandler().releaseLock(conn, lockName);
    } catch (LockException le) {
      getLog().error("Error returning lock: " + le.getMessage(), le);
    }
  }
}

origin: quartz-scheduler/quartz

  t.registerSynchronization(new SemaphoreSynchronization(lockName));
} catch (Exception e) {
  throw new LockException("Failed to register semaphore with Transaction.", e);
origin: quartz-scheduler/quartz

  t.registerSynchronization(new SemaphoreSynchronization(lockName));
} catch (Exception e) {
  throw new LockException("Failed to register semaphore with Transaction.", e);
origin: quartz-scheduler/quartz

    throw new LockException("Failure obtaining db row lock: "
        + sqle.getMessage(), sqle);
  } finally {
throw new LockException("Failure obtaining db row lock, reached maximum number of attempts. Initial exception (if any) attached as root cause.", initCause);
origin: quartz-scheduler/quartz

    throw new LockException("Failure obtaining db row lock: "
        + sqle.getMessage(), sqle);
  } finally {
throw new LockException("Failure obtaining db row lock, reached maximum number of attempts. Initial exception (if any) attached as root cause.", initCause);
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Helper method to get the current <code>{@link javax.transaction.Transaction}</code>
 * from the <code>{@link javax.transaction.TransactionManager}</code> in JNDI.
 * 
 * @return The current <code>{@link javax.transaction.Transaction}</code>, null if
 * not currently in a transaction.
 */
protected Transaction getTransaction() throws LockException{
  InitialContext ic = null; 
  try {
    ic = new InitialContext(); 
    TransactionManager tm = (TransactionManager)ic.lookup(transactionManagerJNDIName);
    
    return tm.getTransaction();
  } catch (SystemException e) {
    throw new LockException("Failed to get Transaction from TransactionManager", e);
  } catch (NamingException e) {
    throw new LockException("Failed to find TransactionManager in JNDI under name: " + transactionManagerJNDIName, e);
  } finally {
    if (ic != null) {
      try {
        ic.close();
      } catch (NamingException ignored) {
      }
    }
  }
}

origin: quartz/quartz-all

/**
 * Helper method to get the current <code>{@link javax.transaction.Transaction}</code>
 * from the <code>{@link javax.transaction.TransactionManager}</code> in JNDI.
 * 
 * @return The current <code>{@link javax.transaction.Transaction}</code>, null if
 * not currently in a transaction.
 */
protected Transaction getTransaction() throws LockException{
  InitialContext ic = null; 
  try {
    ic = new InitialContext(); 
    TransactionManager tm = (TransactionManager)ic.lookup(transactionManagerJNDIName);
    
    return tm.getTransaction();
  } catch (SystemException e) {
    throw new LockException("Failed to get Transaction from TransactionManager", e);
  } catch (NamingException e) {
    throw new LockException("Failed to find TransactionManager in JNDI under name: " + transactionManagerJNDIName, e);
  } finally {
    if (ic != null) {
      try {
        ic.close();
      } catch (NamingException ignored) {
      }
    }
  }
}

origin: quartz/quartz-all

  t.registerSynchronization(new SemaphoreSynchronization(lockName));
} catch (Exception e) {
  throw new LockException("Failed to register semaphore with Transaction.", e);
origin: com.opensymphony.quartz/com.springsource.org.quartz

  t.registerSynchronization(new SemaphoreSynchronization(lockName));
} catch (Exception e) {
  throw new LockException("Failed to register semaphore with Transaction.", e);
origin: com.opensymphony.quartz/com.springsource.org.quartz

  throw new LockException(
    "Failure obtaining db row lock: " + sqle.getMessage(), sqle);
} finally {
origin: com.opensymphony.quartz/com.springsource.org.quartz

  throw new LockException("Failure obtaining db row lock: "
      + sqle.getMessage(), sqle);
} finally {
origin: quartz/quartz-all

  throw new LockException(
    "Failure obtaining db row lock: " + sqle.getMessage(), sqle);
} finally {
origin: quartz/quartz-all

  throw new LockException("Failure obtaining db row lock: "
      + sqle.getMessage(), sqle);
} finally {
org.quartz.impl.jdbcjobstoreLockException

Javadoc

Exception class for when there is a failure obtaining or releasing a resource lock.

Most used methods

  • <init>
  • getMessage

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now