Package org.apache.commons.pool

Examples of org.apache.commons.pool.KeyedObjectPoolFactory


                    cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle);

            final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + ":" + cloudPort + "/" + cloudDbName +
                    "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : ""), cloudUsername, cloudPassword);

            final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);

            final PoolableConnectionFactory cloudPoolableConnectionFactory = new PoolableConnectionFactory(cloudConnectionFactory, cloudConnectionPool, poolableObjFactory,
                    cloudValidationQuery, false, false, isolationLevel);

            // Default Data Source for CloudStack
View Full Code Here


            final ConnectionFactory cloudConnectionFactory =
                new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + cloudDbName +
                    "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : "") +
                    (s_dbHAEnabled ? "&" + cloudDbHAParams : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""), cloudUsername, cloudPassword);

            final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);

            final PoolableConnectionFactory cloudPoolableConnectionFactory =
                new PoolableConnectionFactory(cloudConnectionFactory, cloudConnectionPool, poolableObjFactory, cloudValidationQuery, false, false, isolationLevel);

            // Default Data Source for CloudStack
View Full Code Here

        // pool will use to create Connections.
        // We'll use the DriverManagerConnectionFactory,
        //
        org.apache.commons.dbcp.ConnectionFactory connectionFactory = createConnectionFactory(jcd);

        KeyedObjectPoolFactory statementPoolFactory = createStatementPoolFactory(jcd);
        // set the validation query
        String validationQuery = jcd.getConnectionPoolDescriptor().getValidationQuery();
        boolean defaultReadOnly = false;
        // set autocommit mode
        boolean defaultAutoCommit = (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_FALSE) ?
View Full Code Here

        {
            // mkalen: let the platform set Oracle-specific statement pooling
            return null;
        }

        final KeyedObjectPoolFactory stmtPoolFactory;
        final KeyedPoolableObjectFactory objectFactory = null;
        final GenericKeyedObjectPool.Config factoryConfig = new GenericKeyedObjectPool.Config();
        /*
        // TODO: mkalen: allow to configure PreparedStatement pool
        final int maxTotalStmts = 100;
View Full Code Here

    connectionPool.setMaxActive(maxConns);
    connectionPool.setTestOnBorrow(false);
    connectionPool.setTestOnReturn(false);
    connectionPool.setTestWhileIdle(false);

    KeyedObjectPoolFactory keyedObject = new StackKeyedObjectPoolFactory();
    ConnectionFactory connectionFactory = new OpenbravoDriverManagerConnectionFactory(dbServer,
        dbLogin, dbPassword, dbSessionConfig);
    @SuppressWarnings("unused")
    // required by dbcp
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(
View Full Code Here

                    cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle);

            final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + cloudDbName +
                    "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : "") + (s_dbHAEnabled ? "&" + cloudDbHAParams : "") + (s_dbHAEnabled ? "&loadBalanceStrategy=" + loadBalanceStrategy : ""), cloudUsername, cloudPassword);

            final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);

            final PoolableConnectionFactory cloudPoolableConnectionFactory = new PoolableConnectionFactory(cloudConnectionFactory, cloudConnectionPool, poolableObjFactory,
                    cloudValidationQuery, false, false, isolationLevel);

            // Default Data Source for CloudStack
View Full Code Here

    // Create the factory to be used by the pool to create the connections
    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, user, passwd);

    // Create a factory for caching the PreparedStatements
    KeyedObjectPoolFactory kpf = new StackKeyedObjectPoolFactory(null, 20);

    // Wrap the connections with pooled variants
//    PoolableConnectionFactory pcf =
        new PoolableConnectionFactory(connectionFactory, connectionPool, kpf, null, false, true, Connection.TRANSACTION_READ_COMMITTED);
View Full Code Here

        // pool will use to create Connections.
        // We'll use the DriverManagerConnectionFactory,
        //
        org.apache.commons.dbcp.ConnectionFactory connectionFactory = createConnectionFactory(jcd);

        KeyedObjectPoolFactory statementPoolFactory = createStatementPoolFactory(null);
        // set the validation query
        String validationQuery = jcd.getConnectionPoolDescriptor().getValidationQuery();
        boolean defaultReadOnly = false;
        // set autocommit mode
        boolean defaultAutoCommit = (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_FALSE) ?
View Full Code Here

                    cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle);

            final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + ":" + cloudPort + "/" + cloudDbName +
                    "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : ""), cloudUsername, cloudPassword);

            final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);

            final PoolableConnectionFactory cloudPoolableConnectionFactory = new PoolableConnectionFactory(cloudConnectionFactory, cloudConnectionPool, poolableObjFactory,
                    cloudValidationQuery, false, false, isolationLevel);

            // Default Data Source for CloudStack
View Full Code Here

TOP

Related Classes of org.apache.commons.pool.KeyedObjectPoolFactory

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.