Package com.jolbox.bonecp.hooks

Examples of com.jolbox.bonecp.hooks.AbstractConnectionHook


            bconfig.setCloseConnectionWatchTimeout(10, TimeUnit.MINUTES);
        }
        bconfig.setLazyInit(false);
        bconfig.setDisableJMX(true);
        // Do not manage retry
        ConnectionHook hook = new AbstractConnectionHook() {
            public boolean onAcquireFail(Throwable t, AcquireFailConfig acquireConfig) {
                LOG.error("Failed to obtain connection", t);
                return false;
            }
        };
View Full Code Here


  public void setUp() throws Exception {
    reset(this.mockClass, this.mockCallableStatementCache, this.mockConnection);
    expect(this.mockConnection.getPool()).andReturn(this.mockPool).anyTimes();
    BoneCPConfig config = new BoneCPConfig();
    expect(this.mockPool.getConfig()).andReturn(config).anyTimes();
    config.setConnectionHook(new AbstractConnectionHook() {
      // do nothing
    });
    expect(this.mockConnection.isLogStatementsEnabled()).andReturn(true).anyTimes();
    replay(this.mockConnection, this.mockPool);
    this.testClass = new PreparedStatementHandle(this.mockClass, "", this.mockConnection, "TestSQL", this.mockCallableStatementCache);
View Full Code Here

   
    assertEquals(60000, config.getAcquireRetryDelay());
    assertEquals("foo", config.getDefaultTransactionIsolation());
    assertEquals(123, config.getDefaultTransactionIsolationValue());
   
    ConnectionHook hook = new AbstractConnectionHook() {
      // do nothing
    };
    config.setConnectionHook(hook);
   
    config.setStatementsCachedPerConnection(7);
View Full Code Here

TOP

Related Classes of com.jolbox.bonecp.hooks.AbstractConnectionHook

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.