简体   繁体   English

Lotus Notes - CreateMIMEEntity 未释放对.NSF 文件的控制

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

I am using Interop.Domino to work with.NSF file.我正在使用 Interop.Domino 处理 .NSF 文件。 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.为了生成 html mime 实体,我使用了 nnote,但在某些情况下它无法生成它,因此在这种情况下,我将 RTFTEXT / PLIAN TEXT 设为 output。 so I used CreateMIMEEntity for it.所以我使用了 CreateMIMEEntity。

NotesMIMEEntity MIMEBody = NoteDocument.CreateMIMEEntity("Body"); 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.它可以工作,但它拥有对数据库(.nsf 文件)的控制权,文件被标记为正在另一个进程中使用。 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.我已经释放了所有分配给它的 Note 对象。问题仍然存在。 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. COM 类下的 Notes 核心 DLL 在缓存中保持数据库打开。 The only way that I know of to close them is to terminate the process that loaded the DLLs.我知道关闭它们的唯一方法是终止加载 DLL 的进程。 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.一种选择是使用 COM API 设计代码,以便调度短期工作进程来打开数据库、执行工作并终止。 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. 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.在任何情况下,如果您通过 Domino 服务器打开数据库,缓存的打开数据库不应导致共享冲突。 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.但是,如果您在打开数据库时使用“”而不是服务器名称,这将是一个问题——您甚至不应该在短期运行的工作进程中这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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