Tabnine Logo
DbException.getCause
Code IndexAdd Tabnine to your IDE (free)

How to use
getCause
method
in
org.h2.message.DbException

Best Java code snippets using org.h2.message.DbException.getCause (Showing top 5 results out of 315)

origin: com.h2database/h2

/**
 * Get the SQLException object.
 *
 * @return the exception
 */
public SQLException getSQLException() {
  return (SQLException) getCause();
}
origin: com.eventsourcing/h2

/**
 * Get the SQLException object.
 *
 * @return the exception
 */
public SQLException getSQLException() {
  return (SQLException) getCause();
}
origin: org.wowtools/h2

/**
 * Get the SQLException object.
 *
 * @return the exception
 */
public SQLException getSQLException() {
  return (SQLException) getCause();
}
origin: com.eventsourcing/h2

private long filterConcurrentUpdate(DbException e, long start) {
  int errorCode = e.getErrorCode();
  if (errorCode != ErrorCode.CONCURRENT_UPDATE_1 &&
      errorCode != ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1) {
    throw e;
  }
  long now = System.nanoTime() / 1000000;
  if (start != 0 && now - start > session.getLockTimeout()) {
    throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), "");
  }
  Database database = session.getDatabase();
  int sleep = 1 + MathUtils.randomInt(10);
  while (true) {
    try {
      if (database.isMultiThreaded()) {
        Thread.sleep(sleep);
      } else {
        database.wait(sleep);
      }
    } catch (InterruptedException e1) {
      // ignore
    }
    long slept = System.nanoTime() / 1000000 - now;
    if (slept >= sleep) {
      break;
    }
  }
  return start == 0 ? now : start;
}
origin: org.wowtools/h2

private long filterConcurrentUpdate(DbException e, long start) {
  int errorCode = e.getErrorCode();
  if (errorCode != ErrorCode.CONCURRENT_UPDATE_1 &&
      errorCode != ErrorCode.ROW_NOT_FOUND_IN_PRIMARY_INDEX &&
      errorCode != ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1) {
    throw e;
  }
  long now = System.nanoTime() / 1000000;
  if (start != 0 && now - start > session.getLockTimeout()) {
    throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), "");
  }
  Database database = session.getDatabase();
  int sleep = 1 + MathUtils.randomInt(10);
  while (true) {
    try {
      if (database.isMultiThreaded()) {
        Thread.sleep(sleep);
      } else {
        database.wait(sleep);
      }
    } catch (InterruptedException e1) {
      // ignore
    }
    long slept = System.nanoTime() / 1000000 - now;
    if (slept >= sleep) {
      break;
    }
  }
  return start == 0 ? now : start;
}
org.h2.messageDbExceptiongetCause

Popular methods of DbException

  • getUnsupportedException
    Gets a SQL exception meaning this feature is not supported.
  • throwInternalError
    Throw an internal error. This method seems to return an exception object, so that it can be used ins
  • convert
    Convert a throwable to an SQL exception using the default mapping. All errors except the following a
  • get
    Create a database exception for a specific error code.
  • <init>
  • addSQL
    Set the SQL statement of the given exception. This method may create a new object.
  • convertIOException
    Convert an IO exception to a database exception.
  • convertInvocation
    Convert an InvocationTarget exception to a database exception.
  • convertToIOException
    Convert an exception to an IO exception.
  • getErrorCode
    Get the error code.
  • getInvalidValueException
    Gets a SQL exception meaning this value is invalid.
  • getJdbcSQLException
    Gets the SQL exception object for a specific error code.
  • getInvalidValueException,
  • getJdbcSQLException,
  • getMessage,
  • getSQLException,
  • getSource,
  • getSyntaxError,
  • printStackTrace,
  • setSource,
  • toSQLException

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Notification (javax.management)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
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