Package org.adbcj

Examples of org.adbcj.DbException


      if (isDone() && set) {
        return value;
      }
      return future.get(timeout, unit);
    } catch (ExecutionException e) {
      throw new DbException(e);
    }
  }
View Full Code Here


  private T getResult() throws DbException {
    if (!done) {
      throw new IllegalStateException("Should not be calling this method when future is not done");
    }
    if (exception != null) {
      throw new DbException(exception);
    }
    if (cancelled) {
      throw new CancellationException();
    }
    return result;
View Full Code Here

      }
      String schema = uri.getPath().substring(1);

      return new NettyConnectionManager(host, port, username, password, schema, properties);
    } catch (URISyntaxException e) {
      throw new DbException(e);
    }
  }
View Full Code Here

      return null;
    }
    if (value instanceof Date) {
      return (Date)value;
    }
    throw new DbException(String.format("%s is not a date", value.toString()));
  }
View Full Code Here

  public void beginTransaction() {
    checkClosed();
    synchronized (lock) {
      if (isInTransaction()) {
        throw new DbException(this, "Cannot begin new transaction.  Current transaction needs to be committed or rolled back");
      }
      transaction = new Transaction();
    }
  }
View Full Code Here

  }

  public DbSessionFuture<Void> commit() {
    checkClosed();
    if (!isInTransaction()) {
      throw new DbException(this, "Not currently in a transaction, cannot commit");
    }
    DbSessionFuture<Void> future;
    synchronized (lock) {
      if (transaction.isBeginScheduled()) {
        future = enqueueCommit(transaction);
View Full Code Here

  }

  public DbSessionFuture<Void> rollback() {
    checkClosed();
    if (!isInTransaction()) {
      throw new DbException(this, "Not currently in a transaction, cannot rollback");
    }
    DbSessionFuture<Void> future;
    synchronized (lock) {
      if (transaction.isBeginScheduled()) {
        transaction.cancelPendingRequests();
View Full Code Here

    // Check to see if we're in a transaction
    synchronized (lock) {
      if (transaction != null) {
        if (transaction.isCanceled()) {
          return DefaultDbSessionFuture.createCompletedErrorFuture(
              this, new DbException(this, "Could not execute request; transaction is in failed state"));
        }
        // Schedule starting transaction with database if possible
        if (!transaction.isBeginScheduled()) {
          // Set isolation level if necessary
          enqueueStartTransaction(transaction);
View Full Code Here

      }
      String schema = uri.getPath().substring(1);

      return new MinaConnectionManager(host, port, username, password, schema, properties);
    } catch (URISyntaxException e) {
      throw new DbException(e);
    }
  }
View Full Code Here

    socketConnector.setDefaultRemoteAddress(address);
  }

  public DbFuture<Connection> connect() {
    if (isClosed()) {
      throw new DbException("Connection manager closed");
    }
    logger.debug("Starting connection");
    PgConnectFuture future = new PgConnectFuture();
    socketConnector.connect(future);
View Full Code Here

TOP

Related Classes of org.adbcj.DbException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.