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

io.permazen.core.TransactionException Maven / Gradle / Ivy

Go to download

Permazen core API classes which provide objects, fields, indexes, queries, and schema management on top of a key/value store.

The newest version!

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package io.permazen.core;

import com.google.common.base.Preconditions;

/**
 * Superclass of exceptions associated with a specific {@link Transaction}.
 */
@SuppressWarnings("serial")
public class TransactionException extends DatabaseException {

    private final Transaction tx;

    /**
     * Constructor.
     *
     * @param tx the transaction
     * @param message exception message
     * @throws IllegalArgumentException if {@code tx} is null
     */
    public TransactionException(Transaction tx, String message) {
        super(message);
        Preconditions.checkArgument(tx != null, "null tx");
        this.tx = tx;
    }

    /**
     * Get the associated transaction.
     *
     * @return the transaction in which the error occurred
     */
    public Transaction getTransaction() {
        return this.tx;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy