public Long currentTransactionId() throws SQLException {
        AtomicLong txId = new AtomicLong(0);
        query(
                "select * from txid_current()",
                rs -> {
                    if (rs.next()) {
                        txId.compareAndSet(0, rs.getLong(1));
                    }
                });
        long value = txId.get();
        return value > 0 ? value : null;
    }
Returns the PG id of the current active transaction

@return a PG transaction identifier, or null if no tx is active
@throws SQLException if anything fails.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/postgres-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java