Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:08:16+00:00 2026-06-15T04:08:16+00:00

I am doing a search then looping through the results. This is causing my

  • 0

I am doing a search then looping through the results. This is causing my code to lock up and worse, it is locking up that database from any further use. Even after the browser is closed. It seems this “lockup” is cleared after a period of time of course until I try my code again. I am going to change the way I do this particular task but I was curious as to what is causing this lockup.

     var collection = database.search("Form = 'Request01' & Status='Approved'");

if (collection.getCount() == 0)
{
    getComponent("panel1").setRendered(false);
    getComponent("panel2").setRendered(true);
    getComponent("panel4").setRendered(true);
    return; 
}


dBar.info("Approved Requests Found= " + collection.getCount());

var item:NotesItem = document1.replaceItemValue("DocIds","AAAA");

var doc:NotesDocument = collection.getFirstDocument();

while (doc != null)
{   
    try
    {
        var tmpDoc = collection.getNextDocument(doc);
        item.appendToTextList(doc.getNoteID());
        dBar.info("Processing document: " + doc.getNoteID() )
        doc.recycle();
        doc = tmpDoc;

    }
    catch(e)
    {
        dBar.error(e.message);

    }
}
document1.save();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:08:17+00:00Added an answer on June 15, 2026 at 4:08 am

    The following line…

    var item:NotesItem = document1.replaceItemValue("DocIds","AAAA");
    

    … returns void, your variable item is undefined. The next operation with this

    item.appendToTextList(doc.getNoteID());
    

    throws an error and ends up always in your catch-Block. Then, the next document is never fetched, you have an infinite loop.

    EDIT:
    The replaceItemValue method normally returns the NotesItem, but not for a NotesXspDocument!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some search functionality that can return tens of thousands of results from
Im doing a search where the POST is: sok3 = 0,2,6 I would then
I am doing a ALPHABETICAL ORDER SEARCH module for a project. that is it
I'm doing a lookup from LDAP where I need to search based on a
I'm looping through all the songs from an iPhone's music library using the following
I have a form bean named SearchForm that I use to display search results.
I have a search engine that is supposed to search through descriptions of products
After doing a long search on stackoverflow i didn't find any one talked about
After doing a light search on the Lazarus site I've come to the conclusion
The Mongoid documentation only gives one example of doing a wildcard search: Person.where(first_name: /^d/i)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.