Package org.chaidb.db.transaction.recover

Examples of org.chaidb.db.transaction.recover.TransactionRecover


        String path = DbEnvironment.getDataHome().concat(File.separator).concat(filename);
        return new File(path).delete();
    }

    private void recoverWhenServerStart(boolean needRecovery) throws ChaiDBException {
        TransactionRecover txnRecover;
        if (needRecovery) {
            System.out.println("[" + new Date().toString() + "] Database is recovering from an inconsistent status...");
            // It is NOT a real sys error, just to make message about
            // "begin recovery" visible even at the default log level.
            // This is a request from Sequoia.
            log.info("Begin normal recovery...");
            long begin = System.currentTimeMillis();
            txnRecover = Db.getTxnManager().setRecover(TransactionRecover.NORMAL_RECOVER);
            try {
                txnRecover.doRecover();
                long end = System.currentTimeMillis();
                System.out.println("[" + new Date().toString() + "] Recovery finished in " + ((end - begin) / 1000) + " seconds.");
                log.info("Success of normal recovery!!!");
            } catch (ChaiDBException e) {
                System.out.println("[" + new Date().toString() + "] Failure to do recovery!!! Please refer to log file for more information.");
View Full Code Here

TOP

Related Classes of org.chaidb.db.transaction.recover.TransactionRecover

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.