class PhasingPollTable extends EntityDbTable<PhasingPoll> {

    public List<TransactionDbInfo> getActivePhasedTransactionDbIds(int height) throws SQLException {
        List<TransactionDbInfo> excludeInfos = new ArrayList<>();
        TransactionalDataSource dataSource = databaseManager.getDataSource();
        try (Connection conn = dataSource.getConnection();
             PreparedStatement pstmt = conn.prepareStatement(
                 "SELECT db_id, id FROM transaction WHERE id IN " +
                     "(SELECT id FROM phasing_poll WHERE height < ? AND id not in " +
                     "(SELECT id FROM phasing_poll_result WHERE height <= ?))")) {
            pstmt.setInt(1, height);
            pstmt.setInt(2, height);
            try (ResultSet rs = pstmt.executeQuery()) {
                while (rs.next()) {
                    excludeInfos.add(new TransactionDbInfo(rs.getLong("db_id"), rs.getLong("id")));
                }
            }
        }
        return excludeInfos;
    }

    @Inject public  PhasingPollTable(Blockchain blockchain);

}