In my java webagent I create a Document object. For example NotesDocument document = ...; later I use remove on this object:
document.remove(true);
Afterwards I want to check if document is null so any functions which normally operates on that document will not be executed
for example:
if(document != null){
System.out.println(document.getItemValueString("ID"));
}
It still goes into the if statement and its saying: NotesException: Object has been removed or recycled.
Is != null functioning in this case?
You already created a reference in the memory here.
You can explicitly assign
document = null;
after you callremove()
if that is what you are designated to do.Or
You can check isDeleted() of document. e.g.
if (!document.isDeleted())
.Doc: https://www.ibm.com/support/knowledgecenter/en/SSVRGU_9.0.1/reference/r_domino_Document_IsDeleted.html