h2/src/main/org/h2/mvstore/db/TransactionStore.java
/**
     * End this transaction
     *
     * @param t the transaction
     */
End this transaction
@param t the transaction
End this transaction @param t the transaction
synchronized void endTransaction(Transaction t) {
        if (t.getStatus() == Transaction.STATUS_PREPARED) {
            preparedTransactions.remove(t.getId());
        }
        t.setStatus(Transaction.STATUS_CLOSED);
        if (store.getAutoCommitDelay() == 0) {
            store.commit();
            return;
        }
        if (undoLog.isEmpty()) {
            int unsaved = store.getUnsavedPageCount();
            int max = store.getAutoCommitPageCount();
            if (unsaved * 4 > max * 3) {
                store.commit();
            }
        }
    }
synchronized void endTransaction ( Transaction t ) { if ( t . getStatus ( ) == Transaction . STATUS_PREPARED ) { preparedTransactions . remove ( t . getId ( ) ) ; } t . setStatus ( Transaction . STATUS_CLOSED ) ; if ( store . getAutoCommitDelay ( ) == 0 ) { store . commit ( ) ; return ; } if ( undoLog . isEmpty ( ) ) { int unsaved = store . getUnsavedPageCount ( ) ; int max = store . getAutoCommitPageCount ( ) ; if ( unsaved * 4 > max * 3 ) { store . commit ( ) ; } } }
End this transaction
 @param t the transaction
End this transaction @param t the transaction
// to avoid having to store the transaction log, // if there is no open transaction, // and if there have been many changes, store them now // save at 3/4 capacity