Could this be a bug

We re-developed a web application which was running on 5.09. Now the new app is ready and we wanted to migrate the system. But we cannot take offline the old system.

So what I was doing is creating an agent which is doing the migration process with the following steps.

  1. Creating the databases

  2. Setting the ACL on the databases

  3. Copying the documents from the current system to the new system.

  4. Do the needed changes on the documents

This was tested several times with test databases and it worked fine. Now as I wanted to do the real migration I get problems with step 3. I get all the time the error Stak Overflow when I am copying the databases.

The agent to migrate is written in LS. So, with NotesDatabase.AllDocuments I get all documents from the old database. Then in a while loop i copy them to the new database.

I did not really figure out if the error happens there. But I tried to migrate several database and each time it is crashing at the same time. Then I looke at the number of documents in the new database. It is strange that all of them have the same number of documents. It looks like that the NotesDocumentCollection has a problem handling more than 32768 documents. Then all databases I tried to migrate have this number of documents after the agent crashed with the error Stack Overflow.

So, is the NotesDocumentCollection not able to handle this number of documents? If so, I see a lot of work coming to me.

I am really not a crack. I just have to copy 25 dbs where each one has about 500’000 documents and 3 dbs where each one has 2.500’000 documents. I cannot just do a new copy because this is slowing down the current system to much and the customers are complaining. If there would be another nice to do it would be great. So, any nice hint tip or link would be greatly appreciated.

Subject: Could this be a bug

Are you sure it is a Stack overflow, and not an Integer overflow?

How are you iterating over the documents? You should be using .getFirstDocument() and .getNextDocument() rather than getNthDocument(). It’s a lot faster anyway.

Remember to declare any counter variables as Long rather than Integer.

Without seeing the code that fails, that’s all I can think of…

Subject: RE: Could this be a bug

Yes I am iterating like you said. But the hint for the counter was great. I think this is it. I have a counter to put out some messages and this one is an integer. So, I will change this one to long and try again.

Thanks a lot for the tip. I was looking at everything except this one.