Example usage for org.springframework.dao QueryTimeoutException QueryTimeoutException

List of usage examples for org.springframework.dao QueryTimeoutException QueryTimeoutException

Introduction

In this page you can find the example usage for org.springframework.dao QueryTimeoutException QueryTimeoutException.

Prototype

public QueryTimeoutException(String msg) 

Source Link

Document

Constructor for QueryTimeoutException.

Usage

From source file:com.ge.predix.acs.monitoring.AcsDBHealthIndicatorTest.java

@DataProvider
public Object[][] dp() {

    TitanMigrationManager happyMigrationManager = new TitanMigrationManager();
    TitanMigrationManager sadMigrationManager = new TitanMigrationManager();
    Whitebox.setInternalState(happyMigrationManager, "isMigrationComplete", true);
    Whitebox.setInternalState(sadMigrationManager, "isMigrationComplete", false);

    return new Object[][] { new Object[]

            { mockDBWithUp(), Status.UP, happyMigrationManager },

            { mockDBWithException(new TransientDataAccessResourceException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new QueryTimeoutException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new DataSourceLookupFailureException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new PermissionDeniedDataAccessException("", null)),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithUp(), new Status(AcsMonitoringConstants.ACS_DB_MIGRATION_INCOMPLETE),
                    sadMigrationManager },

    };//from w w  w. j  a  v a 2 s .co m
}

From source file:at.ac.univie.isc.asio.d2rq.pool.PooledD2rqFactory.java

@Override
public QueryExecution execution(final Query query, final Principal owner) {
    try {//from w ww.j a  v a2  s  .  c  o m
        final PooledModel model = pool.claim(timeout);
        if (model == null) {
            throw new QueryTimeoutException("timed out while claiming a d2rq model");
        }
        final QueryExecution execution = model.execution(query);
        execution.setTimeout(executionTimeout, MILLISECONDS);
        return execution;
    } catch (InterruptedException e) {
        throw new CannotAcquireLockException("interrupted while claiming a d2rq model", e);
    }
}

From source file:org.terasoluna.gfw.functionaltest.app.exceptionhandling.ExceptionHandlingController.java

@RequestMapping(value = "3_8", method = RequestMethod.GET)
public String servletFrameworkHandling_03_08() {

    exceptionHandlingService.throwException(new QueryTimeoutException("e.cc.ccc"));

    return "exceptionhandling/index";
}