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

org.noear.wood.DbTranUtil Maven / Gradle / Ivy

The newest version!
package org.noear.wood;

public class DbTranUtil {
    private final static ThreadLocal _tl_tran = new ThreadLocal<>();

    /**
     * 设置线程的当前事务
     */
    public static void currentSet(DbTran tran) {
        _tl_tran.set(tran);
    }

    /**
     * 获取线程的当前事务
     */
    public static DbTran current() {
        return _tl_tran.get();
    }

    /**
     * 移除线程的当前事务
     */
    public static void currentRemove() {
        _tl_tran.remove();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy