Package com.icentris.util

Examples of com.icentris.util.CodeTimer.stop()


    }
    //sendNotification( new Notification(NOTIF_OPENCONNECTION, NOTIF_OPENCONNECTION,
    //                  notificationSequence++, connection.toString()) );
    try {
      ConnectionWrapper connection = pool.prepareConnection();
      timer.stop("ConnectionPool: getConnection");
      // hopefully the common case, we're done!
      return connection;
    } catch (IndexOutOfBoundsException e) {}
    synchronized (pool) {
      boolean timeToCreate = false;
View Full Code Here


      do {
        // try again now that we're synchronized
        if ( pool.connections.size() > 0 ) {
          try {
            ConnectionWrapper connection = pool.prepareConnection();
            timer.stop("ConnectionPool: getConnection");
            return connection;
          } catch (IndexOutOfBoundsException e) {}
        } else if ( pool.connectionCount < pool.getMaxConnections() ) {
          timeToCreate = true;
        } else {
View Full Code Here

    // We should be safe to open a new connection because we already reserved it by
    // doing pool.connectionCount++.  But if we fail in getting the new connection, let's
    // make sure to pool.connectionCount-- so others can try.
    try {
      ConnectionWrapper connection = pool.openNewConnection();
      timer.stop("ConnectionPool: getConnection");
      return connection;
    } catch (SQLException e) {
      pool.connectionCount--;
      timer.stop("ConnectionPool: getConnection");
      throw e;
View Full Code Here

      ConnectionWrapper connection = pool.openNewConnection();
      timer.stop("ConnectionPool: getConnection");
      return connection;
    } catch (SQLException e) {
      pool.connectionCount--;
      timer.stop("ConnectionPool: getConnection");
      throw e;
    }
  }

  /** Should only be called once inside getConnection() method. */
 
View Full Code Here

      // (I'm really sad I can't change the message without losing the stack
      // trace, but having the query helps figure out what went wrong)
      throw new SQLException("The statement:[" + sql + "] had the error: " + e.getMessage());
    } finally {
      if ( timer != null ) {
        timer.stop(callerDepth);
      }
    }
  }

  public int executeUpdate(String sql)
View Full Code Here

      e = new SQLException("The statement:[" + thisToString + "] had the error: " + e.getMessage());
      setMostRecentError(e);
      throw e;
    } finally {
      if ( timer != null ) {
        timer.stop(getCallerDepth());
      }
    }
  }

  public int executeUpdate()
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.