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

com.dexcoder.commons.interceptor.RunBinderTransactionAspectSupport Maven / Gradle / Ivy

The newest version!
package com.dexcoder.commons.interceptor;

import org.springframework.transaction.interceptor.TransactionAspectSupport;

/**
 * Created by liyd on 16/3/17.
 */
public class RunBinderTransactionAspectSupport extends TransactionAspectSupport {

    public static void setRollbackOnly() {
        TransactionAspectSupport.TransactionInfo transactionInfo = currentTransactionInfo();
        if (transactionInfo != null && transactionInfo.hasTransaction()) {
            transactionInfo.getTransactionStatus().setRollbackOnly();
        }
    }

    public static boolean isRollbackOnly() {
        TransactionAspectSupport.TransactionInfo transactionInfo = currentTransactionInfo();
        if (transactionInfo != null && transactionInfo.hasTransaction()) {
            return transactionInfo.getTransactionStatus().isRollbackOnly();
        }
        return false;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy