developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




CopyToDatabase working very slow
amar ku das 01/05/2016 07:27 AM
Notes Client 7.0.3 Windows Vista


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

Go back