Tabnine Logo
BoneCP.getConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
getConfig
method
in
com.jolbox.bonecp.BoneCP

Best Java code snippets using com.jolbox.bonecp.BoneCP.getConfig (Showing top 12 results out of 315)

origin: org.apache.sentry/sentry-shaded-miscellaneous

/** Thread constructor
 * @param connectionPartition partition to monitor
 * @param pool Pool handle.
 */
public PoolWatchThread(ConnectionPartition connectionPartition, BoneCP pool) {
  this.partition = connectionPartition;
  this.pool = pool;
  this.lazyInit = this.pool.getConfig().isLazyInit();
  this.acquireRetryDelayInMs = this.pool.getConfig().getAcquireRetryDelayInMs();
  this.poolAvailabilityThreshold = this.pool.getConfig().getPoolAvailabilityThreshold();
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

/** Sends any configured SQL init statement. 
 * @throws SQLException on error
 */
public void sendInitSQL() throws SQLException {
  sendInitSQL(this.connection, this.pool.getConfig().getInitSQL());
}
origin: io.vertx/vertx-jdbc-client

@Override
public int maximumPoolSize(DataSource dataSource, JsonObject config) {
 if (dataSource instanceof BoneCPDataSource) {
  BoneCPConfig cfg = ((BoneCPDataSource) dataSource).getPool().getConfig();
  return cfg.getMaxConnectionsPerPartition() * cfg.getPartitionCount();
 }
 return -1;
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

public String toString(){
  long timeMillis = System.currentTimeMillis();
  return Objects.toStringHelper(this)
      .add("url", this.pool.getConfig().getJdbcUrl())
      .add("user", this.pool.getConfig().getUsername())
      .add("debugHandle", this.debugHandle)
      .add("lastResetAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionLastResetInMs))
      .add("lastUsedAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionLastUsedInMs))
      .add("creationTimeAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionCreationTimeInMs))
      .toString();
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

this.connectionHook = pool.getConfig().getConnectionHook();
this.url = pool.getConfig().getJdbcUrl();
this.finalizableRefs = pool.getFinalizableRefs(); 
this.defaultReadOnly = pool.getConfig().getDefaultReadOnly();
this.defaultCatalog = pool.getConfig().getDefaultCatalog();
this.defaultTransactionIsolationValue = pool.getConfig().getDefaultTransactionIsolationValue();
this.defaultAutoCommit = pool.getConfig().getDefaultAutoCommit();
this.resetConnectionOnClose = pool.getConfig().isResetConnectionOnClose();
this.connectionTrackingDisabled = pool.getConfig().isDisableConnectionTracking();
this.statisticsEnabled = pool.getConfig().isStatisticsEnabled();
this.statistics = pool.getStatistics();
this.detectUnresolvedTransactions = pool.getConfig().isDetectUnresolvedTransactions();
this.detectUnclosedStatements = pool.getConfig().isDetectUnclosedStatements();
this.closeOpenStatements = pool.getConfig().isCloseOpenStatements();
if (this.closeOpenStatements){
  trackedStatement = new MapMaker().makeMap();
this.connectionHook = this.pool.getConfig().getConnectionHook();
this.maxConnectionAgeInMs = pool.getConfig().getMaxConnectionAge(TimeUnit.MILLISECONDS);
this.doubleCloseCheck = pool.getConfig().isCloseConnectionWatch();
this.logStatementsEnabled = pool.getConfig().isLogStatementsEnabled();
int cacheSize = pool.getConfig().getStatementsCacheSize();
if ( (cacheSize > 0) && newConnection ) {
  this.preparedStatementCache = new StatementCache(cacheSize, pool.getConfig().isStatisticsEnabled(), pool.getStatistics());
  this.callableStatementCache = new StatementCache(cacheSize, pool.getConfig().isStatisticsEnabled(), pool.getStatistics());
  this.statementCachingEnabled = true;
origin: org.apache.sentry/sentry-shaded-miscellaneous

/** Private -- used solely for unit testing. 
 * @param connection
 * @param preparedStatementCache
 * @param callableStatementCache
 * @param pool
 * @return Connection Handle
 */
protected static ConnectionHandle createTestConnectionHandle(Connection connection, IStatementCache preparedStatementCache, IStatementCache callableStatementCache, BoneCP pool){
  ConnectionHandle handle = new ConnectionHandle();
  handle.connection = connection;
  handle.preparedStatementCache = preparedStatementCache;
  handle.callableStatementCache = callableStatementCache;
  handle.connectionLastUsedInMs = System.currentTimeMillis();
  handle.connectionLastResetInMs = System.currentTimeMillis();
  handle.connectionCreationTimeInMs = System.currentTimeMillis();
  handle.recoveryResult = new TransactionRecoveryResult();
  handle.trackedStatement = new MapMaker().makeMap();
  handle.url = "foo";
  handle.closeOpenStatements = true;
  handle.pool = pool;
  handle.url=null;
  int cacheSize = pool.getConfig().getStatementsCacheSize();
  if (cacheSize > 0) {
    handle.statementCachingEnabled = true;
  }
  return handle;
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

Connection result = null;
Connection oldRawConnection = connectionHandle.getInternalConnection();
String url = this.getConfig().getJdbcUrl();
int acquireRetryAttempts = this.getConfig().getAcquireRetryAttempts();
long acquireRetryDelayInMs = this.getConfig().getAcquireRetryDelayInMs();
AcquireFailConfig acquireConfig = new AcquireFailConfig();
acquireConfig.setAcquireRetryAttempts(new AtomicInteger(acquireRetryAttempts));
acquireConfig.setAcquireRetryDelayInMs(acquireRetryDelayInMs);
acquireConfig.setLogMessage("Failed to acquire connection to "+url);
ConnectionHook connectionHook = this.getConfig().getConnectionHook();
do{ 
  result = null;
    tryAgain = false;
    if (acquireRetryAttempts != this.getConfig().getAcquireRetryAttempts()){
      logger.info("Successfully re-established connection to "+url);
    ConnectionHandle.sendInitSQL(result, this.getConfig().getInitSQL());
  } catch (SQLException e) {
origin: org.wisdom-framework/wisdom-jdbc-datasources

Connection result;
Connection oldRawConnection = connectionHandle.getInternalConnection();
String url = this.getConfig().getJdbcUrl();
int acquireRetryAttempts = this.getConfig().getAcquireRetryAttempts();
long acquireRetryDelayInMs = this.getConfig().getAcquireRetryDelayInMs();
AcquireFailConfig acquireConfig = new AcquireFailConfig();
acquireConfig.setAcquireRetryAttempts(new AtomicInteger(acquireRetryAttempts));
acquireConfig.setAcquireRetryDelayInMs(acquireRetryDelayInMs);
acquireConfig.setLogMessage("Failed to acquire connection to " + url);
ConnectionHook connectionHook = this.getConfig().getConnectionHook();
do {
  result = null;
    tryAgain = false;
    if (acquireRetryAttempts != this.getConfig().getAcquireRetryAttempts()) {
      LOGGER.info("Successfully re-established connection to " + url);
    ConnectionHandle.sendInitSQL(result, this.getConfig().getInitSQL());
  } catch (SQLException e) {
origin: org.apache.sentry/sentry-shaded-miscellaneous

ConnectionHook connectionHook = con.getPool().getConfig().getConnectionHook();
int acquireRetryAttempts = con.getPool().getConfig().getAcquireRetryAttempts();
long acquireRetryDelay = con.getPool().getConfig().getAcquireRetryDelayInMs();
AcquireFailConfig acquireConfig = new AcquireFailConfig();
acquireConfig.setAcquireRetryAttempts(new AtomicInteger(acquireRetryAttempts));
origin: org.apache.sentry/sentry-shaded-miscellaneous

  @Override
  public String toString() {
    return Objects.toStringHelper(this)
        .add("url", this.pool.getConfig().getJdbcUrl())
        .add("user", this.pool.getConfig().getUsername())
        .add("minConnections", this.getMinConnections())
        .add("maxConnections", this.getMaxConnections())
        .add("acquireIncrement", this.acquireIncrement)
        .add("createdConnections", this.createdConnections)
        .add("freeConnections", this.getFreeConnections())
        .toString();
  }
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

/**
 * Partition constructor
 *
 * @param pool handle to connection pool
 */
public ConnectionPartition(BoneCP pool) {
  BoneCPConfig config = pool.getConfig();
  this.minConnections = config.getMinConnectionsPerPartition();
  this.maxConnections = config.getMaxConnectionsPerPartition();
  this.acquireIncrement = config.getAcquireIncrement();
  this.url = config.getJdbcUrl();
  this.username = config.getUsername();
  this.password = config.getPassword();
  this.poolName = config.getPoolName() != null ? "(in pool '"+config.getPoolName()+"') " : "";
  this.pool = pool;
  
  this.disableTracking = config.isDisableConnectionTracking();
  this.queryExecuteTimeLimitInNanoSeconds = TimeUnit.NANOSECONDS.convert(config.getQueryExecuteTimeLimitInMs(), TimeUnit.MILLISECONDS);
}
origin: org.apache.sentry/sentry-shaded-miscellaneous

this.connectionHandle = connectionHandle;
this.logStatementsEnabled = logStatementsEnabled;
BoneCPConfig config = connectionHandle.getPool().getConfig();
this.connectionHook = config.getConnectionHook();
this.statistics = connectionHandle.getPool().getStatistics();
com.jolbox.bonecpBoneCPgetConfig

Javadoc

Gets config object.

Popular methods of BoneCP

  • getConnection
  • shutdown
    Closes off this connection pool.
  • <init>
    Constructor.
  • getTotalCreatedConnections
    Return total number of connections created in all partitions.
  • getTotalLeased
    Return total number of connections currently in use by an application
  • captureStackTrace
    Throw an exception to capture it so as to be able to print it out later on
  • closeStatement
  • getDbIsDown
    Returns the dbIsDown field.
  • getStatistics
    Returns a reference to the statistics class.
  • getTotalFree
    Return the number of free connections available to an application right away (excluding connections
  • internalReleaseConnection
    Release a connection by placing the connection back in the pool.
  • isConnectionHandleAlive
    Sends a dummy statement to the server to keep the connection alive
  • internalReleaseConnection,
  • isConnectionHandleAlive,
  • maybeSignalForMoreConnections,
  • obtainRawInternalConnection,
  • postDestroyConnection,
  • putConnectionBackInPartition,
  • registerUnregisterJMX,
  • unregisterDriver,
  • destroyConnection

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Best IntelliJ plugins
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