Package org.fcrepo.server.storage

Examples of org.fcrepo.server.storage.ConnectionPool


            throw new ModuleInitializationException("ConnectionPoolManager module was required, but apparently has "
                                                            + "not been loaded.",
                                                    getRole());
        }
        String cPoolName = getParameter("connectionPool");
        ConnectionPool cPool = null;
        try {
            if (cPoolName == null) {
                logger.debug("connectionPool unspecified; using default from "
                        + "ConnectionPoolManager.");
                cPool = cpm.getPool();
View Full Code Here


            throw new ModuleInitializationException("ConnectionPoolManager module was required, but apparently has "
                                                            + "not been loaded.",
                                                    getRole());
        }

        ConnectionPool cPool;
        try {
            cPool = cpm.getPool();
        } catch (ConnectionPoolNotFoundException e1) {
            throw new ModuleInitializationException("Could not find requested "
                    + "connectionPool.", getRole());
View Full Code Here

        }
    }

    protected void checkRebuildHasRun(boolean firstRun) throws Exception {
        Connection conn = null;
        ConnectionPool cpm = SQLUtility.getConnectionPool(getConfig());
        try {
            conn = cpm.getReadWriteConnection();
            long mostRecentRebuildDate = SQLUtility.getMostRecentRebuild(conn);
            if (firstRun && mostRecentRebuildDate == -1) {
                // if first run and rebuildStatus has NO ROWS, create one
                SQLUtility.recordSuccessfulRebuild(conn, System.currentTimeMillis());
            } else {
                // otherwise, verify that the most recent rebuild was successful
                boolean rebuildFinished =
                        SQLUtility.getRebuildStatus(conn, mostRecentRebuildDate);
                if (!rebuildFinished) {
                    throw new ServerInitializationException(
                            "The SQL Rebuild attempted on "
                            + new Date(mostRecentRebuildDate).toGMTString()
                            + " did not finish successfully, which may compromise"
                            + " the repo. Please re-run the SQL rebuild.");
                }
            }
        } finally {
            if (conn != null) cpm.free(conn);
        }
    }
View Full Code Here

                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
        return new ConnectionPool(cpDriver,
                                  cpURL,
                                  cpUsername,
                                  cpPassword,
                                  ddlConverter,
                                  cpMaxActive,
View Full Code Here

    //   - drop doRegistry table (silently fail if it doesn't exist)
    //   - re-create doRegistry table
    @Before
    public void setUpTest() throws Exception {
        if (cPool == null) {
            cPool = new ConnectionPool(driver,
                                       url,
                                       username,
                                       password,
                                       maxActive,
                                       maxIdle,
View Full Code Here

    @Before
    public void createConnectionPool() throws SQLException {
        // Create a connection pool that uses the Mock Driver and some other
        // plausible values.
        this.connectionPool = new ConnectionPool(MockDriver.class.getName(),
                "mock://bogus.url", "bogusUsername", "bogusPassword", 5, 5, 5,
                0, 0, 2, 300, null, false, false, false, (byte) 0);
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.storage.ConnectionPool

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.