Package org.opensolaris.opengrok.jdbc

Examples of org.opensolaris.opengrok.jdbc.ConnectionResource


        int fileId = files.get(repo_path);
        for (HistoryEntry entry : hist.getHistoryEntries()) {
            retry:
            for (int i = 0;; i++) {
               
                final ConnectionResource conn =
                        connectionManager.getConnectionResource();
               
                addFilemove = conn.getStatement(ADD_FILEMOVE);
                addFilechange = conn.getStatement(ADD_FILECHANGE);
               
                try {
                    int changesetId = getIdForRevision(entry.getRevision(),
                        getRepositoryId(conn, repository));

                    /*
                     * If the file exists in the changeset, store it in
                     * the table tracking moves of the file when it had
                     * one of its precedent names so it can be found
                     * when performing historyget on directory.
                     */
                    if (entry.getFiles().contains(repo_path)) {
                        addFilechange.setInt(1, changesetId);
                        addFilechange.setInt(2, fileId);
                        addFilechange.executeUpdate();
                    } else {
                        addFilemove.setInt(1, changesetId);
                        addFilemove.setInt(2, fileId);
                        addFilemove.executeUpdate();
                    }

                    conn.commit();
                    break retry;
                } catch (SQLException sqle) {
                    handleSQLException(sqle, i);
                    conn.rollback();
                } finally {
                    connectionManager.releaseConnection(conn);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.jdbc.ConnectionResource

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.