package io.seata.rm.datasource.extend;


import io.seata.core.exception.TransactionException;
import io.seata.rm.datasource.ConnectionProxy;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * Seata 自定义扩展管理器
 *
 * @author wangchunxiang
 * @date 2024/08/07
 */
public interface FtbSeataExtendManager {

    /**
     * Flush undo logs.
     *
     * @param cp  the cp
     * @param xid the xid
     * @throws SQLException SQLException
     */
    void flushUndoLogsConnection(ConnectionProxy cp,String xid) throws SQLException;

    /**
     * Delete undo log.
     *
     * @param xid      the xid
     * @param conn     the conn
     * @throws SQLException the sql exception
     */
    void undoLogConnection(String xid, Connection conn) throws TransactionException;

}
