简体   繁体   中英

Lotus Notes - CreateMIMEEntity not releasing the control of .NSF file

I am using Interop.Domino to work with.NSF file. To generate the html mime entity I used the nnote but in some case it failed to generate it so in that case I took the RTFTEXT / PLIAN TEXT as output. so I used CreateMIMEEntity for it.

NotesMIMEEntity MIMEBody = NoteDocument.CreateMIMEEntity("Body");

It works but it holds the control on the Database (.nsf file), file is getting mark as being used in another process. By troubleshooting it it clear that above statement holds the control. I have released all the Note objects assigned with it.Still problem remains same. Is there are proper way to use it or release it?

The Notes core DLLs that are underneath the COM classes keep databases open in cache. The only way that I know of to close them is to terminate the process that loaded the DLLs. One option is to design code using the COM API so that it dispatches short-term worker processes to open the database, do the work, and terminate. Yeah, it's ugly and slow, but if you need a long-running service and you're using the COM API instead of the Notes C API, it's the best way.

In any case, the cached open databases should not cause a sharing violation if you are opening the database through the Domino server. If you are using "" instead of the server name when opening the database however, it's going to be a problem -- and you shouldn't even do that in short-running worker processes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM