Package com.sleepycat.bdb

Examples of com.sleepycat.bdb.CurrentTransaction$Trans


    final boolean beginAutoCommit() {

        if (isAutoCommit()) {
            try {
                CurrentTransaction currentTxn = view.getCurrentTxn();
                if (currentTxn.getTxn() == null) {
                    currentTxn.beginTxn();
                    return true;
                }
            } catch (DbException e) {
                throw new RuntimeExceptionWrapper(e);
            }
View Full Code Here



    public static DbTxn createTransaction(DbEnv environment) throws DbException {
        // TODO remove dirty hack!
        cachedEnvironment = environment;
        CurrentTransaction currentTxn = CurrentTransaction.getInstance(environment);
        return currentTxn.beginTxn();
        /**
         // TODO temporary hack until BDB supports nested transactions
         if (getTransactionCount() == 0) {
         DbTxn transaction = environment.txnBegin(getTransaction(), TRANSACTION_FLAGS);
         pushTransaction(transaction);
View Full Code Here

     * @param transaction
     * @throws javax.jms.JMSException if the transaction could not be committed
     */
    public static DbTxn commitTransaction(DbTxn transaction) throws JMSException {
        try {
            CurrentTransaction currentTxn = CurrentTransaction.getInstance(cachedEnvironment);
            currentTxn.commitTxn();
            return null;
        }
        catch (DbException e) {
            throw JMSExceptionHelper.newJMSException("Failed to commit transaction: " + transaction + " in container: " + e, e);
        }
View Full Code Here

     * @param transaction
     */
    public static void rollbackTransaction(DbTxn transaction) {
        if (transaction != null) {
            try {
                CurrentTransaction currentTxn = CurrentTransaction.getInstance(cachedEnvironment);
                currentTxn.abortTxn();
            }
            catch (DbException e) {
                log.warn("Cannot rollback transaction due to: " + e, e);
            }
        }
View Full Code Here


    public static DbTxn createTransaction(DbEnv environment) throws DbException {
        // TODO remove dirty hack!
        cachedEnvironment = environment;
        CurrentTransaction currentTxn = CurrentTransaction.getInstance(environment);
        return currentTxn.beginTxn();
        /**
         // TODO temporary hack until BDB supports nested transactions
         if (getTransactionCount() == 0) {
         DbTxn transaction = environment.txnBegin(getTransaction(), TRANSACTION_FLAGS);
         pushTransaction(transaction);
View Full Code Here

     * @param transaction
     * @throws javax.jms.JMSException if the transaction could not be committed
     */
    public static DbTxn commitTransaction(DbTxn transaction) throws JMSException {
        try {
            CurrentTransaction currentTxn = CurrentTransaction.getInstance(cachedEnvironment);
            currentTxn.commitTxn();
            return null;
        }
        catch (DbException e) {
            throw JMSExceptionHelper.newJMSException("Failed to commit transaction: " + transaction + " in container: " + e, e);
        }
View Full Code Here

     * @param transaction
     */
    public static void rollbackTransaction(DbTxn transaction) {
        if (transaction != null) {
            try {
                CurrentTransaction currentTxn = CurrentTransaction.getInstance(cachedEnvironment);
                currentTxn.abortTxn();
            }
            catch (DbException e) {
                log.warn("Cannot rollback transaction due to: " + e, e);
            }
        }
View Full Code Here

TOP

Related Classes of com.sleepycat.bdb.CurrentTransaction$Trans

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.