Field length stored in document is incorrect

hi every one,what I am trying to do : Replace an exisiting document in a database2 with the one in database1 with out changing the note id(business req).

what have I done : delete all items in the document in database2 copy all the items using

following code

LNItemArray itemsArray;

docindb1.GetItems(&itemsArray);

for(int n=0;n<lItemCount;++n) docindb2.CreateItem(itemsArray[n],LNITEMOPTION_DELETE_APPEND);

problem: “Field length stored in document is incorrect” occurs randomly after processing some set of documents.

Do u guys think of any better procedure of doing it? or any clues.

Appreciate your help