CopyToDatabase working very slow

Hi All,

I have code which copydocument from one Database A to another database B and then delete document from Database A , so it is simple but in server i have schedule this agent and it running very very slow and i don’t know why it runs slow i have schedule this agent every 1 hours but in one hours it only 40 to 5 document copy not more than and in databse A more than 2lks document exits , can any one help me ?

My Code is below

Dim S As New NotesSession

Dim W As NotesUIWorkSpace

Dim Db As NotesDatabase, SMArcDb As NotesDatabase

Dim SMAllotDoc As NotesDocument,  ToArcDoc As NotesDocument

Dim SMAllotView As NotesView





Set Db = S.CurrentDatabase

Set SMAllotView = Db.GetView("(ArchiveAllotDetailsData)")

SMAllotView.AutoUpdate =False

Set SMArcDb = New NotesDatabase(Db.Server,"Dolphin\Live\SiteMinderAllotArc.nsf")

'Set SMArcDb = New 

If SMAllotView.AllEntries.Count> 0 Then

	Set SMAllotDoc = SMAllotView.GetFirstDocument

	While Not SMAllotDoc Is Nothing

		

		Set ToArcDoc = SMAllotDoc

		Call SMAllotDoc.CopyToDatabase(SMArcDb)				

		

		

		Set SMAllotDoc = SMAllotView.GetNextDocument(SMAllotDoc)

		If Not ToArcDoc Is Nothing Then

			Call ToArcDoc.Remove( True )

		End If	

		Call SMAllotView.Refresh

	Wend

End If

Subject: CopyToDatabase working very slow

Are you really expecting to refresh a view containing 200,000 documents 200,000 times in less than an hour? Moving the Refresh out of the loop should speed things up considerably.

Subject: RE: CopyToDatabase working very slow

@Stan Rogers yes you are right i don’t see this refresh write with in loop it is very silly mistake any after all we all are human being thanks …