All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.devsmart.microdb.Transaction Maven / Gradle / Ivy

There is a newer version: 0.3.17
Show newest version
package com.devsmart.microdb;


import java.io.Closeable;
import java.io.IOException;

public class Transaction implements Closeable {

    private MicroDB mDB;
    private boolean mSuccess;

    public Transaction(MicroDB db) {
        mDB = db;
    }

    public void markSuccessfull() {
        mSuccess = true;
    }

    public void endTransaction() {
        if (mSuccess) {
            //mDB.commitTransaction();
        } else {
            //mDB.rollbackTransaction();
        }

    }

    @Override
    public void close() throws IOException {
        endTransaction();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy